Hello,
I have been given a class diagram where a variable called light_years must be a const int and stored in the space class, but later on that value must be used in the main file.
Below is the space class
class space
{
private:
static const int LIGHT_YEARS;
public:
// -Many functions are here-
};
I need to access the value here
#include "stdafx.h"
#include <iostream>
#include "Space.h"
int _tmain(int argc, _TCHAR* argv[])
{
for (int i=0; i<3; i++)
{
8*LIGHT_YEARS; // I've tried 8*Space::LIGHT_YEARS;
}
system("pause");
return 0;
}
Is there someway to friend the main function or how can I go about doing this? apeciate any help!