0

I don't know why i am getting error help me to fix

Here is my code: #ifndef MYCLASS_H #define MYCLASS_H class MyClass { public: MyClass(); protected: private: }; Error: <stdin>:1:2: error: unterminated conditional directive #ifndef MYCLASS_H

3rd Nov 2020, 4:13 PM
Krishna Chandra
Krishna Chandra - avatar
1 Odpowiedź
+ 1
Add #endif directive below class definition. Unlike regular if...else block which are formed by brackets, preprocessor directive #if needs to be paired with #endif #ifndef MYCLASS_H #define MYCLASS_H class MyClass { public: MyClass(); protected: private: }; #endif // add this
3rd Nov 2020, 4:21 PM
Ipang