#include <iostream.h>
#include <string>
void main()
{
char name[10];
int num_name;
int count;
cout << "How many names do you want to enter?\n";
cout << "Answer: ";
cin >> num_name;
int j =1;
cout << "\nEnter names\n";
for (count=1; count<=num_name; count++)
{
cout << j << "." <<" name: ";
cin >> name[count];
j = j+1;
}
for (count=1; count<=num_name; count++)
{
cout << "\n" << count << "." << name[count] ;
}
cout << "\n\n";
}
My task is to input names as many as the user wants to input. My problem is how to make this character into string that will accept names and not just character...
hope someone could help me out here. thanks in advance