stupid question about ascii characters

i know it's out there, but I cannot remember how to check if a given ascii character string contains all digits or not ... any ideas?

ie...function("123") --> OK
function("NOT_A_NUMBER") --> returns error

thanks!!

isdigit will test a single character. I guess you could try strtol on the string and see what happens. Or maybe strspn() with a second string of "0123456789"? I don't think there is a function that does precisely what you want. Of course, it would be a snap to write one.

i think isdigit() was the function I was trying to remember (though it doesn't work completely the way I described)

thanks!!