Code:
#include <iostream>
using namespace std;
string func1 ()
{
string name;
getline (cin,name);
cout << name << endl;
return name;
}
string func2 (string x);
////////////////////// main here we start//
int main () //
{ //
string name_in_main; //
//
name_in_main = func1 (); //
//
//
//
func2 (name_in_main); //
//
return 0; //
} //
///////////////////////////////////////////
string func2 (string nameq)
{
cout << nameq << endl;
getline (cin,nameq);
cout << nameq << endl;
}
I have just written for you
copy and paste in your compiler
and tell me if this is what you were looking for
well here you can use more than 1 word as I used
Code:
getline (cin,"string")
instead of you can use too if you wish