I have a C++ class that has a data member in it which is an object, and I'd like to use a value of that object as a default parameter to an error method. I know this sounds very convoluted, so I'll just show you the header code, hopefully that will speak for itself:
// Method declaration int error( int code = object->code() ); // Object declaration Object object;
As you can see, I'm trying to get the error status of this object, and the default way to do this should be to use an integer that comes from a cal to this object.
So, as my code stands now, I get this error at link time:
invalid use of non-static data member 'object'
If I make 'object' static, I get this error:
undefined reference to 'object'
I have a feeling there's something with syntax I'm missing; can anyone please help me figure out what it is?