Hi,
How do I properly put this to code? I am trying to return a string (name) from a function using reference.
I hope you get the idea. Thanks!Code:std::string& name() { cout << "Enter your name: " << endl; getline(cin, name); }
Hi,
How do I properly put this to code? I am trying to return a string (name) from a function using reference.
I hope you get the idea. Thanks!Code:std::string& name() { cout << "Enter your name: " << endl; getline(cin, name); }