Non type class
Hey guys basically, im trying to save a value in a member object in c ++.
Code:
class readNasdaq string NasdaqValue = line.substr( LocationNasdaqValue , LengthOfNasdaqValue ) ; Code:
cout << " " << endl ; readNasdaq.w(); w.value(); But for some reason, i keep getting an error message saying... Code:
financetest.cpp:28: error: request for member ‘Nasdaq’ in ‘w’, which is of non-class type ‘readNasdaq ()()' |
Can you post more of your source code (if you want) to allow tracing the error?
Code:
readNasdaq.w(); You cannot call "value" in an object of class "readNasdaq", because class std::string does not implement the operator(). Posting more source code can really help. Especially post line 28, where the error resides. |
Quote:
Quote:
readNasdaq.w(); is to define w as an object of type readNasdaq using the default constructor. The correct syntax for that would be: readNasdaq w; Your intent for w.value() is to access the value member of w? The correct syntax for that would be: w.value But remember value is a member of each object of type readNasdaq, so you can't communicate a value by setting it in one object and accessing it in another. If you want one value for all readNasdaq, make it a static class member, not an ordinary class member. |
All times are GMT -5. The time now is 09:00 AM. |