我遇到一个处理菜单的程序的一些例子..
正如我所理解的那样,他在 main 函数之前声明了所有函数,然后在 main 中也提到了一个 void 函数的函数:
char get_choice(void);
char get_first(void);
int get_int(void);
void count(void);
int main(void)
{
int choice;
void count(void);
while ( (choice = get_choice()) != 'q')
{
switch (choice)
{
case 'a' : printf("Buy low, sell high.\n");
break;
case 'b' : putchar('\a'); /* ANSI */
break;
case 'c' : count();
break;
default : printf("Program error!\n");
break;
}
}
printf("Bye.\n");
...(功能实现)
你能告诉我这是为什么吗?tnx