problem with code

im trying to practice coding and my programe wont compile. i also would like to know why. thanks :)

//
#include<iostream>
#include<ctype.h>
#include<String.h>

using namespace std;

int main()
{
char first[80];
cout<<"\nwhat is your name?";
cin >> first;

if(isalpha(first))
cout<<"\nnice job,"<<first<<'\n';
else
cout<<"\nthat is not a name!\n";

system ("pause");
return 0;
}
isalpha() checks for a single character (a char). You are looking for a function that checks whether all the chars in an array of chars are alphanumeric. Try creating yourself that function, which could run a loop through the array, and do the isalpha() check for each character.
i see!! thanks i know exactly what your saying.
Topic archived. No new replies allowed.