CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Computer Programming (http://www.codingforums.com/forumdisplay.php?f=21)
-   -   space (http://www.codingforums.com/showthread.php?t=16249)

Xiang 03-13-2003 07:40 AM

space
 
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 :-)


All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.