Hy家伙,我写了一个程序,在C编程中画一条线。正如我们所知,windows7/8不直接支持全屏,当我从turboC++编译时,它运行正确,但是当我构建它并进入turboC++文件夹并从那里执行时,它给我一个消息,支持全屏应用程序,现在应该怎么做才能在Windows 7/8中运行。我写的代码是:全屏的C程序应用程序不工作在Windows 7/8
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
clrscr();
/* request auto detection */
int gdriver = (DETECT)/3, gmode, errorcode;
int midx, midy;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "C:/TURBOC3/BGI/");
/* 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());
line(midx, midy, midx/2,midy/2);
/* clean up */
getch();
closegraph();
return 0;
}
什么可能是解决方案?我只是位于C初学者...如果我很抱歉不能够让你清晰... 我还附上错误的我得到了什么图片,..
“XY不能在Windows上工作” - 真是个惊喜...... – 2012-12-26 08:25:03
您是否考虑过使用像Qt这样的跨平台GUI工具包? –
nope,因为我们的教授不允许使用除TurboC++之外的其他任何东西,我使用的是TurboC++,并且全屏不能正常工作,请正确查看问题@ H2CO3 ... –