Gabriel P. answered 01/04/22
Tutor
New to Wyzant
Yes, you can return a string variable from a function.
Torion J.
asked 12/08/21#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
string func1();
{
string response;
cout << "Hello World!" << endl;
getline(cin, response);
return response;
}
return 0;
}
Gabriel P. answered 01/04/22
Yes, you can return a string variable from a function.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.