Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ctype.h>
- int checkIfInt(char input[]){
- int i=0;
- char c;
- while((c=input[i])!='\0'){ //ficnhé non arrivato a terminazione della stringa
- if(!isdigit(c)){
- return -1;
- }
- i++;
- }
- return atoi(input);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement