多个函数

mac2025-12-06  9

/*two_func.c --一个文体中包含两种函数*/ #include<stdio.h> void butler (void); /*ANSI/ISO C 函数原型*/ /*第一个void代表无返回值,第二个void代表不带参数*/ /*butler函数调用(function call)形式出现*/ int main(void) { printf("I will summon the butler function.\n"); butler(); printf("Yes.Bring me some tea and writeable DVDs.\n"); return 0 /*此函数是包括在主函数中的,所以即使butler无返回值,在末尾也加了return 0*/ } void butler (void) /*函数定义开始*/ { printf("You rang,sir?\n"); }

1.无论main()在程序文件中处于什么位置,所有的程序都从main()开始执行

最新回复(0)