I got it!! For those who are interested...
Code:
#include <iostream.h>
#include <ctype.h>
#include <string.h>
const int MAX = 3;
bool validID(char [][10]);
void assignNames(char [][10]);
void main(void)
{
char names[MAX][10];
//get ids'
for (int count = 0; count < MAX; count++)
{
cout << "Enter name: ";
cin >> names[count];
}
//display ids
for (count = 0; count < MAX; count++)
{
cout <<"Name " << count + 1 <<
" is " << names[count] << "\n";
}
//ids valid or not
for (count=0;count<MAX;count++)
{
if (validID(names))
cout<<"Valid."<<endl;
else
cout<<"Invalid"<<endl;
}
for (count = 0; count < MAX; count++)
{
cout <<"\n""Name " << count + 1 <<
" is " << names[count] << "\n";
}
}
bool validID(char id[][10])
{
int length,y;
for (int x=0; x<MAX; x++)
{
length=strlen(id[x]);
if (length>4)
return false;
}
for ( x=0,y=0; y<1, y!='\0'; y++ )
{
if (!isalpha(id[x][y]))
return false;
}
for ( x=1,y=1; x<MAX, y<4; y++ )
{
if (!isdigit(id[x][y]))
return false;
}
return true;
}