+ 1

Can any one please tell what I am doing wrong

please tell fast https://code.sololearn.com/cBXQq38f9D09/?ref=app

2nd Jun 2018, 4:19 AM
Syed Shaheryar
Syed Shaheryar - avatar
3 Réponses
+ 1
got the answer I had to put brackets after getname cout << getname(); ^ |
2nd Jun 2018, 4:46 AM
Syed Shaheryar
Syed Shaheryar - avatar
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.
2nd Jun 2018, 4:28 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
0
didn't work bro
2nd Jun 2018, 4:37 AM
Syed Shaheryar
Syed Shaheryar - avatar