c++ class why need main?

后端 未结 5 2057
难免孤独
难免孤独 2021-01-27 01:28

Hello I\'m writing a little project in c++ where I would like to have some classes that does some work, I wrote the interfaces and the implementation of the classes.

The

5条回答
  •  不思量自难忘°
    2021-01-27 01:51

    class animal
    {
     public: 
       animal();
      ~animal();
    
     public:
       method1(int arg1);
    
     private:
       int var1;
    };
    

    Notice you didn't put a semi-colon at the end of the class declaration. C++ requires it and sometimes gives confusing/misleading error messages if you forget it.

提交回复
热议问题