程序清單2.3_two_func.c_《C Primer Plus》P25
阿新 • • 發佈:2018-05-31
C Primer Plus// two_func.cpp : 定義控制臺應用程序的入口點。
//
/* two_func.c -- 在一個文件中使用兩個函數 */
/*
時間:2018年05月30日 22:53:38
代碼:程序清單2.3_two_func.c_《C Primer Plus》P25
目的:在一個文件中使用兩個函數,了解函數使用的位置
*/
#include "stdafx.h"
void butler(void); /* ISO/ANSI C 函數原型 */
int _tmain(int argc, _TCHAR* argv[])
{
printf("I will summon the butler function.\n");
butler();
printf("Yes. Bring me some tea and writeable CD-ROMS.\n");
getchar();
return 0;
}
void butler(void) /* 函數定義的開始 */
{
printf("You rang, sir?\n");
}
/*
在VS2010中運行結果:
---------------------------------------------
I will summon the butler function.
You rang, sir?
Yes. Bring me some tea and writeable CD-ROMS.
---------------------------------------------
*/
程序清單2.3_two_func.c_《C Primer Plus》P25