我是靠谱客的博主 贤惠柠檬,最近开发中收集的这篇文章主要介绍c语言vs可视outtext,C语言 closegraph()用法及代码示例,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

头文件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;

}

输出:

c2af53bbf58fbe5aec912158bdbd03b8.png

注意:执行程序时,输出窗口如下所示。按任意键时,closegraph()将关闭图形模式。

最后

以上就是贤惠柠檬为你收集整理的c语言vs可视outtext,C语言 closegraph()用法及代码示例的全部内容,希望文章能够帮你解决c语言vs可视outtext,C语言 closegraph()用法及代码示例所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(91)

评论列表共有 0 条评论

立即
投稿
返回
顶部