...

View Full Version : space



Xiang
03-13-2003, 07:40 AM
Dear sir,

I trying to write a program that accept alphanumeric from users. It will display an "Error!" message if users include space and negative number.

num_string[100];
void main(void)
a=0;

printf("Enter a word ")
gets(num_string);

{
if (isalphanum(num_string[a] && !isspace(num_string[idx])
valid = 1;
else
valid = 0;
}
if ((valid ==0) && num_string < 0)
prinf("Error!");


Thanks

Xing

Phantom
03-13-2003, 09:09 PM
prinf("Error!");

You're going to have some problems there - printf :-)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum