易截截图软件、单文件、免安装、纯绿色、仅160KB

关于C的一个初级图形问题 - C/C++ / C语言

最近我在网上看到一个用C语言编程输出一个矩形的程序,但是照着程序复制一遍,运行时出现如下错误:
error:undefine symbol 'DELECT'
 #include <graphics.h>
  #include <stdlib.h>
  #include <stdio.h>
  #include <conio.h>
  int main(void)
  {
  int gdriver = DETECT, gmode, errorcode;
  int left, top, right, bottom;
  initgraph(&gdriver, &gmode, "");
   
  errorcode = graphresult();
  if (errorcode != grOk) {
  printf("Graphics error: %s\n", grapherrormsg(errorcode));
  printf("Press any key to halt:");
  getch();
  exit(1); }
  left = getmaxx() / 2 - 50;
  top = getmaxy() / 2 - 50;
  right = getmaxx() / 2 + 50;
  bottom = getmaxy() / 2 + 50;
  rectangle(left,top,right,bottom);
  getch();
  closegraph();
  return 0;
  }
哪位大虾看看出了什么问题
在找,没发现,,,可能太菜鸟了。

讲得很清楚的吧,引用变量没有定义,DELECT变量没有定义的啊。。。
感觉原因可能是conio.h文件不是标准的库文件,你没有调用到吧。

改DELECT为DETECT,


相关问答:

linux环境下gethostbyname函数问题 - C/C++ / C语言

写了个测试程序如下
   
  struct hostent *hp; 
char AlarmDevIP[20];  
  int x2;

hp = gethostbyname("www.google.com");
if (hp)
{ ......

c静态编译另一个文件夹的库函数 - C/C++ / C语言

在根目录/lib中存放一个log.c,log.h,并用下面的语句:
gcc -c log.c
ar crv liblog.a log.o
编译出一个liblog.a静态库,然后在文件夹:/testfile中创建一个test.c和testc.c,test.c中引用了testc.c中定义的方法 ......

求助:C代码change toVB代码 - VB / 基础类

挺繁琐,之前发的帖子,分值太低现在重发一个。欢迎各位大侠~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[] ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号