概述
头文件graphics.h包含closegraph()函数,该函数关闭图形模式,释放由图形系统分配的所有内存,并将屏幕恢复为调用initgraph之前的模式。
用法:
void closegraph();
以下是closegraph()在C中的实现。
// C Implementation for closegraph()
#include
// driver code
int main()
{
// gm is Graphics mode which is
// a computer display mode that
// generates image using pixels.
// DETECT is a macro defined in
// "graphics.h" header file
int gd = DETECT, gm;
// initgraph initializes the
// graphics system by loading a
// graphics driver from disk
initgraph(&gd, &gm, "");
// outtext function displays
// text at current position.
outtext("Press any key to close"
" the graphics mode !!");
getch();
// closegraph function closes the
// graphics mode and deallocates
// all memory allocated by
// graphics system .
closegraph();
return 0;
}
输出:
注意:执行程序时,输出窗口如下所示。按任意键时,closegraph()将关闭图形模式。
最后
以上就是贤惠柠檬为你收集整理的c语言vs可视outtext,C语言 closegraph()用法及代码示例的全部内容,希望文章能够帮你解决c语言vs可视outtext,C语言 closegraph()用法及代码示例所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复