Non-class type error



Registered: Jan 2010
Posts: 53
Thanked: 0

Non type class
Hey guys basically, im trying to save a value in a member object in c ++.

1
2
3
4
5
6
7
8
9
Code:

class readNasdaq
{
    public:
        void Nasdaq(fstream&) ;
        string value ;
    private :
};

This is in my cpp file
1
2
3
4
5
6
7
8
string NasdaqValue = line.substr( LocationNasdaqValue , LengthOfNasdaqValue ) ;

Code:

   cout << "  " << endl ;
cout << "The Value Index of Nasdaq is " << NasdaqValue << endl ;

 value = NasdaqValue ;


Am i right to say that now value can be called to be used at other places by
1
2
readNasdaq.w();
w.value();

But for some reason, i keep getting an error message saying...
1
2
3
Code:

financetest.cpp:28: error: request for member ‘Nasdaq’ in ‘w’, which is of non-class type ‘readNasdaq ()()' 

why is that? and how do i solve this problem?
Are you sure its supposed to be readNasdaq.w() and not w.readNasdaq()?
Please go through the tutorial.
http://www.cplusplus.com/doc/tutorial/
Topic archived. No new replies allowed.