#include<iostream>
using namespace std;
const int namesize=21;
void getName(char,int);
void main()
{
int index=5;
int count;
char names[21];
char *aString=names;
for(count=0;count<index;count++)
{
char names;
getName(*aString,index);
cout << "You entered: ";
cout << &names;
 
 
}
}
void getName (char names[][21], int index)
{ 
cout << "enter a name: ";
cin >> names[index];
}

I need to enter 5 names

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.