c++ - foo2.cpp:9: error: expected primary-expression before '(' token -


what error in file? get:

 foo2.cpp:9: error: expected primary-expression before '(' token foo2.cpp:9: error: expected primary-expression before 'int' foo2.cpp:9: error: expected ';' before '{' token 
int main(void) {   class x {     int i;   public:     x(int ii = 0);   };    x::x(int ii) { = ii; }   return 0; } 

first, may ask, why?

second, can't provide implementation inside method (including main). if must this, keep implementation inline:

int main() {   class x {     int i;   public:     x(int ii = 0){ = ii; }   };   return 0; } 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -