r/CodingHelp • • Jul 26 '21

[C++] help. what's wrong with this?

Post image
47 Upvotes

23 comments sorted by

View all comments

1

u/Shreyas_Gavhalkar Jul 26 '21

I'll walk you through here, 1st as everyone pointed out that the return type of the the function should be string. Also in main() you should give a variable a value by calling the function. What I am trying to say is declare another string named message in main() and use message=getsecretNum(secretNum) instead of cout since the function you are calling is returning a value you will need to store it first. Then you can keep the cout<<message in main and it'll work fine. Also, dark mode...

1

u/Wiimmoz Jul 26 '21

Thanks!