#include <iostream>
using namespace std;
void welcome();
int main(int argc, char** argv)
{
char name[50], gender;
cout<<"Name: ";
cin.getline(name,50); //info name is collected
cout<<endl;
cout<<"Gender: ";
cin>>gender;
welcome();
return 0;
}
void welcome()
{
cout<<endl<<"Hi "<<name; //how can i transfer the info name collected in main() to this function?
cout<<" welcome to C++!";
}
Last edited on