/*6.修改程序清单 8.8 中的 get_first()函数,使其返回所遇到的第一个非空白字符。在一个简单的程序中测试该函数。*/
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
char get_first(void);
int main()
{
putchar(get_first());
system("pause");
return 0;
}
char get_first(void)
{
int a;
while ((a = getchar()) != EOF)
{
if (!isspace(a) && (a != '\n'))
return a;
}
}