diff --git a/x_ctypes/src/x_ctypes.c b/x_ctypes/src/x_ctypes.c new file mode 100644 index 0000000..f49da04 --- /dev/null +++ b/x_ctypes/src/x_ctypes.c @@ -0,0 +1,13 @@ +#include + +int x_isdigit(const char x){ + if ( x > 48 && x < 57 ){ + return 1; + } + else if ( x > 0 && x < 9 ){ + return 1; + } + + return 0; +} + diff --git a/x_ctypes/src/x_ctypes.h b/x_ctypes/src/x_ctypes.h new file mode 100644 index 0000000..3d08dab --- /dev/null +++ b/x_ctypes/src/x_ctypes.h @@ -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