Browse Source

implemented gethd

remotes/origin/userinput
TheUltimateOptimist 11 months ago
parent
commit
d378fa1a31
  1. 7
      src/userinput.c

7
src/userinput.c

@ -6,6 +6,7 @@
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include <stdbool.h> #include <stdbool.h>
#include <limits.h>
#define LD(name)\ #define LD(name)\
long double name##ldvalue;\ long double name##ldvalue;\
@ -160,3 +161,9 @@ long double getNumber(char *message, long double *min, long double *max, long do
fflush(stdout); fflush(stdout);
} }
} }
short gethd(char *message, short *min, short *max) {
LD(min)
LD(max)
return getNumber(message, minld, maxld, NULL, NULL, SHRT_MIN, SHRT_MAX);
}
Loading…
Cancel
Save