// Get a Yes/No response from the user bool promptYesNo( const char* prompt, const char* def ) { bool rc = false; char buf[2]; promptInput( prompt, def, buf, 2 ); rc = (*buf == 'Y' || *buf == 'y'); return rc; }
int promptInteger( const char* prompt, const char* def ) { int value; char buf[16]; promptInput( prompt, def, buf, 16 ); if (isInteger(buf)) { value = atoi(buf); } else { value = atoi(def); } return value; }
void myMain() { promptInput(); deBlank(scanLine(input, LINE), output, (int)strlen(input) + 1); printf("%s", output); }