Hey guys,
I need to make a program that reads a user inputted (cin) line and stores it in a char array. easy?
cout << "Enter your name" << endl;
cin.getline(name, 50);
name's declared as an array.
This is fine... but I need it in a seperate function that returns the data to main...
5 words for this:
I hate scope.
Thank you.
what i tried:
void Names(int i, char &name);
void main(void)
{
char name[50];
int i=1;
while (i < 4)
{
Names(int i, char &
i++;
}
fout.close();
}
void Names(int i, char &name)
{
cout << "Please enter your full name" << endl;
cin.getline(char name, 256, '\n');
}