#include "input.h" int integer_input(char* val) { int num; char *error = ""; do { printf("\n%s\n%s",error, val); fflush(stdout); char buf[128]; read(STDIN_FILENO, buf, 127); num = atoi(buf); error = "Input Error, try again."; } while(!num); return num; }