static void cliInput(char const* prompt, char* buf, size_t buf_size)
{
char* p;
do {
printf("%s",prompt);
*buf = '\0';
fgets(buf, buf_size, stdin);
p = buf + strlen(buf);
} while (p <= buf+1);
if (*(p-1) == '\n') {
*--p = '\0';
}
}
댓글 없음:
댓글 쓰기