Added x_is_digit function
This commit is contained in:
parent
5b3224c60c
commit
c69f18a479
13
x_ctypes/src/x_ctypes.c
Normal file
13
x_ctypes/src/x_ctypes.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int x_isdigit(const char x){
|
||||
if ( x > 48 && x < 57 ){
|
||||
return 1;
|
||||
}
|
||||
else if ( x > 0 && x < 9 ){
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
8
x_ctypes/src/x_ctypes.h
Normal file
8
x_ctypes/src/x_ctypes.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef X_CTYPES_H
|
||||
#define X_CTYPES_H
|
||||
|
||||
|
||||
// returns 0 if x is not a digit and 1 if it is
|
||||
int x_isdigit(char x);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user