[plug] C, bad syntax etc.

Bret Busby bret at busby.net
Tue Nov 19 11:10:08 WST 2002


On Tue, 19 Nov 2002, John Knight wrote:

> 
> Cheers mate, don't worry, it's out of the loop. ;) Now I'm trying to figure 
> out how to search through text for numbers only! *groan* heh. ;)
> 
> 

1. using a switch statement for each case of 0,1,2,3,4,5,6,7,8,9, then 
the break?

2. using isnum ? (isalnum then isalpha)
Could be done using #define to define macro isnum as 
(if(isalnum(variable_name) && if(!(isalpha(variable_name)))
assuming that you are searching for numbers, as opposed to digits, in 
which case you have isdigit, and you could probably use
while(isdigit(variablename)) to retrieve numbers
?

? here is not the conditional operator :)


-- 
Bret Busby
Armadale
West Australia
..............

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
  Chapter 28 of the Hitchhiker's Guide to the Galaxy
- Douglas Adams, 1988
....................................................



More information about the plug mailing list