+ 1

I am getting this error on creating a Project in Dev cpp

Main Program:- #include<iostream> #include "MyClass.h" using namespace std; int main() { MyClass obj; obj.myPrint(); return 0; } MyClass.h file:- #ifndef MYCLASS_H #define MYCLASS_H class MyClass { public: MyClass(); void myPrint(); ~MyClass(); protected: private: }; #endif //MYCLASS_H MyClass.cpp :- #include "MyClass.h" #include<iostream> using namespace std; MyClass::MyClass() { cout<<"Constructor"<<endl<<"Saying Hello"<<endl; } void MyClass::myPrint() { cout<<"Hello"; } MyClass::~MyClass() { cout<<"Destructor"<<endl; }

27th Jul 2022, 3:03 AM
Prachi Porwal
Prachi Porwal - avatar
1 Antwort
0
could you write the error message not in tags section?
30th Jul 2022, 8:20 PM
Patrick
Patrick - avatar