View Single Post
Old Feb 17th, 2005, 11:40 AM   #4
Hockeyman
Programmer
 
Hockeyman's Avatar
 
Join Date: Jan 2005
Location: Vancouver, Canada
Posts: 60
Rep Power: 4 Hockeyman is on a distinguished road
Send a message via MSN to Hockeyman
The scanf function uses pointers (aaaaaarrrgggghhhh)

try:

printf("\nType number or name: ");
scanf("%d", &value);
if (isdigit(value))
printf("\nNumber");
else
printf("\nLetter");

I'm not sure if this'll make any difference, but I'd use %c in the scanf to read in a char, instead of %d to read in a decimal integer - although that could just be my preference rather than any C rule.
__________________
~ You know, Hobbes, some days even my lucky rocketship underpants don't help. ~

Hockeyman is offline   Reply With Quote