Hey. I have this class
Code:
class Railcar
{
private:
string cartype;
int ID;
int train;
public:
Railcar(string c, int i, int t): cartype(c),ID(i),train(t) { }
Railcar(): cartype(""),ID(0),train(0) { }
int IDtrain() { return train; }
friend ostream & operator<<(ostream &, Railcar & R);
};
and I want to access the train variable and store it onto a queue. But when I write this(where temp is a variable of type Railcar):
Code:
if (X.IDtrain==1)
{ one.push_front(temp);
cout<< temp <<endl;
}
It gives and error that IDtrain doesn't like ==
So can someone tell me how I get it to use the variable I want?!?