【求助】谁能帮我看看这段代码哪里出错了,运行不了
#include<stdio.h>#include <conio.h>
#include <stdlib.h>
#include <string.h>
void main(void)
{
FILE *fp;
int i,n;
double x1[100],y1[100],x2[100],y2[100];
double x11,x22,y11,y22;
char *name,*chat;
if((fp=fopen(c:"key.dxf","w"))==NULL)
{
fprintf(fp,"CANNOT OPEN FILE\n");
exit(1);
}
fscanf(fp,"%s",chat);
if(chat="ENTITIES"||chat="entities")
for(i=1;i<=2;i++)
{
fscanf(fp,"%s",chat);
if(chat="LINE"||chat="line")
{
fscanf(fp,"%s",chat);
fscanf(fp,"%s",chat);
fscanf(fp,"%s2d",&n);
fscanf(fp,"%1f",&x11);
x1[i]=x11;
fscanf(fp,"%2d",&n);
fscanf(fp,"%1f",&y11);
y1[i]=y11;
fscanf(fp,"%2d",&n);
fscanf(fp,"%1f",&y22);
x2[i]=x22;
fscanf(fp,"%2d",&n);
fscanf(fp,"%1f",&y22);
y2[i]=y22;
printf("x1=%8.2f y1=%8.2f\n",x1[i],y1[i]);
printf("x2=%8.2f y2=%8.2f\n",x2[i],y2[i]);
}
}
fscanf(fp,"%s",chat);
fscanf(fp,"%s",chat);
if(chat="ENDSEC"||chat="endsec")
fscanf(fp,"%s",chat);
if(chat="EOF"||chat="eof")
exit(1);
fclose(fp);
}