我们先看具体的例子:
#include void pound(int n); // ANSI function prototype declarationint main(void){ int times = 5; char ch = '!'; // ASCII code is 33 float f = 6.0f; pound(times); // int argument pound(ch); // same as pound((int)ch); pound(f); // same as pound((int)f); return 0;}void pound(int n) // ANSI-style function header{ // says takes one int argument while (n-- > 0) printf("#"); printf("");}//输出结果为:#+RESULTS:: #####: #################################: ######
程序的函数头部:
void pound(int n)
如果函数不接受任何参数,函数头