0
Even though I know the cause of error,but I don't know,why the __cout << "hii"__ line don't work?
Is this an compile error or run time error, May I get an output,if it is an runtime error https://sololearn.com/compiler-playground/cgxsdTB5a0NX/?ref=app
2 Respuestas
+ 2
C++ is a compiled language.
The code needs to be compiled first before it can run.
Your class instantiation raises an error which prevents the program from compiling. That's why the cout<<"hii"; is not printed.
+ 2
Read the error message: myClass::myClass() is private!
The constructor needs to be public so the object can be created.