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 | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 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; }

25th Sep 2017, 6:11 PM
Shivani Goyal
0 Réponse