CLearn/Chapter_2/2_3_two_func.c

20 lines
470 B
C

/* 一个文件中包含两个函数 */
#include <stdio.h>
void butler(void);//函数原型(声明)
//这个是现代写法,早期写法长这样:
//void butler();
//不推荐上面的写法
int main(void)
{
printf("I will summon the butler function.\n");
butler();
printf("Yes. Bring me some tea and writeable DVDs.\n");
return 0;
}
void butler(void) //函数定义
{
printf("You rang, sir?\n");
}//这种写法有利于厘清程序逻辑