C语言函数叙述 c语言函数用法举例( 二 )


3、从计算机组成原理的角度来看,函数即是一个小型的计算机系统,依据冯诺伊曼的“存储程序原理”,每一个计算机系统包含C语言函数叙述:输入系统、输出系统、运算器以及控制器 , 实际上对于C语言中的函数来说 , 它是“存储程序原理”的软实现,其中形参、实参这是输入系统,返回值是输出系统,函数体中的运算符,比如+、-、*、/四则运算即为运算器,而逻辑运算符以及if、while等控制语句便是一个控制器 。
详细的C语言函数介绍函数名: cleardevice
功能: 清除图形屏幕
用法: void far cleardevice(void);
程序例:
#include graphics.h
#include stdlib.h
#include stdio.h
#include conio.h
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
/* initialize graphics and local variables */
initgraph(gdriver, gmode, "");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk)/* an error occurred */
{
printf("Graphics error: %s/n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
setcolor(getmaxcolor());
/* for centering screen messages */
settextjustify(CENTER_TEXT, CENTER_TEXT);
/* output a message to the screen */
outtextxy(midx, midy, "press any key to clear the screen:");
/* wait for a key */
getch();
/* clear the screen */
cleardevice();
/* output another message */
outtextxy(midx, midy, "press any key to quit:");
/* clean up */
getch();
closegraph();
return 0;
}
C语言函数1.
主函数定义Score[]的时候要加上数组宽度 , 比如Score[100];
2.
Average函数里面不要重复定义n,你传参的时候已经传了;
3.
Average函数在实现的时候不要加分号;
如果改了还不对的话给我发组数据,不知道你想干什么 。。。。
【C语言函数叙述 c语言函数用法举例】C语言函数叙述的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于c语言函数用法举例、C语言函数叙述的信息别忘了在本站进行查找喔 。

推荐阅读