test digits for "string" datatype

Started by
1 comment, last by Joker2000 23 years, 9 months ago
How can I test a string datatype for all digits? Notice I said string datatype...NOT character array! The isdigit works on char number[5] , not string number . --- Joker2000 Stevie Ray Vaughan - The Legend Edited by - Joker2000 on 7/17/00 4:05:11 PM
Advertisement
You should be able to access every single char from the string data type and test it with the isdigit macro. Hope this helps.

-------------------------------------
That's just my 200 bucks!

..-=gLaDiAtOr=-..
If you want your string to be treated as a regular C string you have to use .cstr();

so try your isdigit on number.cstr()



Edited by - SoGreen on July 17, 2000 5:49:52 PM
There's always something smaller and something bigger. Don't sweat the small stuff and don't piss off the big stuff :)

This topic is closed to new replies.

Advertisement