C语言画图
我的目的:在VC++6.0环境里,用C语言开发一个小游戏----俄罗斯方块
因为C语言有操作图形的库
因此在VC6.0里新建了工程
代码如下:
#include "stdafx.h"
#include <graphics.h>
int main(int argc, char* argv[])
{
int graphdriver = DETECT;
int graphmode;
initgraph(&graphdriver, &graphmode, "");
cleardevice();
for(int i=20; i<=300; i+=16)
{
putpixel(i, 20, 1);
putpixel(i+4, 20, 2);
}
getch();
closegraph();
return 0;
}
fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory