+ 1
Can any one please tell what I am doing wrong
please tell fast https://code.sololearn.com/cBXQq38f9D09/?ref=app
3 Réponses
+ 1
got the answer
I had to put brackets after getname
cout << getname();
^
|
0
getname is a method, not a member and thus, you need to add a set of empty parenthesis after the name to call it.
Secondly, the getname() method returns the string, but does not print it. So you need to print it via cout.
cout<<Po.getname();
// This will print the name to the terminal.
0
didn't work bro