0
in a method PrintName , if i want to print name if i use " cout<<name;" it works , but not if i use " return name". Why?
2 Respostas
+ 5
If you want to use return name, you have to change the return type of the method printNane , from void to string. The cout only prints on screen, the return returns something which is different.
https://code.sololearn.com/cUxl7vG6Hfo0/?ref=app
+ 2
thank you! i was confused whith that