Holding multi values with one variable
Hello all, I am a newb. I am wondering how I could hold multiple values in one variable. Lets say I have a program that asks for 200 peoples names. I do not want to create 200 variable for each person. This is what I was thinking but it over writes the previous entree of course.
Code:
char name[30];
for (int i = 0; i < 256; i++)
{
cout << "Enter your name\n";
cin >> name;
} //End For Loop
Then I was thinking of outputing each name to a file and reading all the information back in but want to know if there is another way to do this. I am missing something here I know it. If you have a better way to do this please let me know. Thanks
Bitphire
EDIT:
In a class at the moment so cant test this but would a multi-array thing work??
ex:
name[30][30];