Sorry to say that the question is not related to Fedora Core at all, the only thing to do with Fedora Core is I am using its newly integrated Eclipse Platform to do my high school computing homework.![]()
![]()
![]()
![]()
The question ask me to use static as such
and I declare it the same way as other variable type as int, float etc.Code:class Bookshop { private: ... static unsigned transOkcount; //number of successful transactions static unsigned transNotOkcount; //number of unsuccessful transactions ... public: ... static unsigned gettransOkcount(); //get number of successful transactions static unsigned gettransNotOkcount();//get number of unsuccessful transactions ... }
but I got errorsCode:static unsigned Bookshop::gettransOkcount() { return transOkcount; } static unsigned Bookshop::gettransNotOkcount() { return transNotOkcount; }
I know it may not be right to ask such question here, but any kind person can just help me solve it? REALLY THANKS!Code:Severity Description Resource In Folder Location Creation Time error: cannot declare member function ‘static unsigned int Bookshop::gettransOkcount()’ to have static linkage Bookshop.cpp CW3 line 48 July 8, 2005 7:44:31 PM error: cannot declare member function ‘static unsigned int Bookshop::gettransNotOkcount()’ to have static linkage Bookshop.cpp CW3 line 52 July 8, 2005 7:44:31 PM![]()
![]()
![]()
![]()


Reply With Quote
