+ 1
In this program XV line of the code if write public instead of private the output of the program is same and 22 line of the prog
#include <iostream> using namespace std; class myClass { public: myClass() { cout <<"Hey"; } void setName(string x) { name = x; } string getName() { return name; } private: string name; }; int main() { myClass myObj; return 0; }
1 Respuesta