Chapter 10: Problem 2
Find the errors in the following class and explain how to correct them: class Example { public: Example( int y = 10 ) : data( y ) { // empty body } // end Example constructor int getIncrementedData() const { return data++; } // end function getIncrementedData [Page 569] static int getCount() { cout << "Data is " << data << endl; return count; } // end function getCount private: int data; static int count; }; // end class Example
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.