问题遇到的现象和发生背景 敲c primer plus 代码的时候
问题相关代码,请勿粘贴截图
char get_choice(void)
{
int ch;
printf("Enter the letter of your choice:\n");
printf("a. advice b.bell\n");
printf("c.count q.quit\n");
ch = get_first();
while ((ch <'a' || ch > 'c' ) && ch != 'q');
{
printf("please respond with a, b, c, or q.\n");
ch = get_first();
}
return ch;
}
char get_first(void)
{
int ch;
ch = getchar();
while (getchar() != '\n')
continue;
return ch;
}
运行结果及报错内容 :第四行 error: `printf' was not declared in this scope
第七行 error: get_first' was not declared in this scope 第十八行 error:
getchar' was not declared in this scope
我的解答思路和尝试过的方法
没有思路