修改程序清单8.8中的get_first()函数,使其返回所遇到的第一个非空白字符,在一个简单的程序
中测试。
#include <stdio.h>
#include <ctype.h>
#include <windows.h>
char get_first(void);
int main(void)
{
char ch;
ch = get_first();
printf("%c\n", ch);
system("pause");
return 0;
}
char get_first()
{
int ch;
while (isspace(ch = getchar()))
continue;
while (getchar() != '\n')
continue;
return ch;
}