Created
April 13, 2012 20:03
-
-
Save larryv/2379742 to your computer and use it in GitHub Desktop.
Determine whether a C string consists entirely of digits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int is_valid_ref(char *arg) | |
{ | |
do { | |
if (!isdigit(*arg)) | |
return 0; | |
} while (*++arg); | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment