This is my C++ homework and its driving me fricken crazy.
Error:
C:\Documents and Settings\Desktop\New Folder\Class\class.cpp(31) : error C2511: 'get_count' : overloaded member function 'const int (void)' not found in 'Counter'
c:\documents and settings\desktop\new folder\class\counter.h(6) : see declaration of 'Counter'
He gave us the header file, I can only change the implementation. What am I doing wrong?
Code:
class Counter
{
public:
Counter( ); // default constructor - initializes count to 0
Counter ( int v); // constructor - initializes count to v
void increment( int v = 1); // increments count by argument value
void decrement (int v = 1); // decrements count by argument value
void reset ( ); // resets count to 0
int get_count ( ) const; // returns count
private:
int count;
};
Code:
int Counter::get_count()
{
return count;
}
Error:
C:\Documents and Settings\Desktop\New Folder\Class\class.cpp(31) : error C2511: 'get_count' : overloaded member function 'const int (void)' not found in 'Counter'
c:\documents and settings\desktop\new folder\class\counter.h(6) : see declaration of 'Counter'
He gave us the header file, I can only change the implementation. What am I doing wrong?
Last edited: