For context, I am brand new in C++, I program in Java. So I am very bad with C++ syntax and would require dumbed down answers.
I cannot seem to understand why I am getting this error. I checked multiple answers but they are all for primitive variables. I am using objects, which I am guessing is causing some error or I just am blind.
Here is my class, the focus is on 3 static variables under public
class SuperMarket
{
private:
int count;
int totalService;
int totalWait;
public:
static CustomerQ * regularLine; // this
static CustomerQ * expressLine; // this
static EventQ * eventQueue; // this
// Constructors
SuperMarket();
// Destructor
~SuperMarket();
// Accessors
void start(int choice, string file);
static void loop();
// Mutators
};
I initialize the static members in my constructor
SuperMarket::SuperMarket() // Constructor
{
count = 0;
totalService = 0;
totalWait = 0;
regularLine = new CustomerQ(); *error*
expressLine = new CustomerQ(); *error*
SuperMarket::eventQueue = new EventQ(); *error*
}
As well as anywhere else I do SuperMarket::Object I get the error. I tried using both SuperMarket:: and without as you can see, but my error doesn't go away. Of course outside my SuperMarket class I do SuperMarket:: as well.