Why isn't the semi-colon (;) req'd after this statement
in the following code? Is it because it is an automatically inlined function or just because it is a function or for some other reason? Please give reason why ; is not needed or required here. It is a statement isn't it. A semi-colon is required at the end of a statement.Code:void addIncrement() { count += increment; }
Code:// Fig. 7.2: fig07_02.cpp // Using a member initializer to initialize a // constant of a built-in data type. #include <iostream> using std::cout; using std::endl; class Increment { public: Increment( int c = 0, int i = 1 ); void addIncrement() { count += increment; } //Why isn't a semi-colon (;) req'd here? void print() const; private: int count; const int increment; // const data member };



LinkBack URL
About LinkBacks


