e:\microsoft visual studio\myprojects\1314\1111.cpp(15) : error C2065: 'c' : undeclared identifier
e:\microsoft visual studio\myprojects\1314\1111.cpp(15) : error C2143: syntax error : missing ')' before ':'
e:\microsoft visual studio\myprojects\1314\1111.cpp(15) : error C2059: syntax error : ')'
e:\microsoft visual studio\myprojects\1314\1111.cpp(16) : error C2143: syntax error : missing ';' before '{'
e:\microsoft visual studio\myprojects\1314\1111.cpp(21) : warning C4800: 'char *' : forcing value to bool 'true' or 'false' (performance warning)
e:\microsoft visual studio\myprojects\1314\1111.cpp(21) : error C2106: '=' : left operand must be l-value
e:\microsoft visual studio\myprojects\1314\1111.cpp(21) : error C2440: '=' : cannot convert from 'bool' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
e:\microsoft visual studio\myprojects\1314\1111.cpp(25) : warning C4800: 'char *' : forcing value to bool 'true' or 'false' (performance warning)
e:\microsoft visual studio\myprojects\1314\1111.cpp(25) : error C2106: '=' : left operand must be l-value
e:\microsoft visual studio\myprojects\1314\1111.cpp(25) : error C2440: '=' : cannot convert from 'bool' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
e:\microsoft visual studio\myprojects\1314\1111.cpp(47) : warning C4800: 'char *' : forcing value to bool 'true' or 'false' (performance warning)
e:\microsoft visual studio\myprojects\1314\1111.cpp(47) : error C2106: '=' : left operand must be l-value
e:\microsoft visual studio\myprojects\1314\1111.cpp(47) : error C2440: '=' : cannot convert from 'bool' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
e:\microsoft visual studio\myprojects\1314\1111.cpp(49) : warning C4800: 'char *' : forcing value to bool 'true' or 'false' (performance warning)
e:\microsoft visual studio\myprojects\1314\1111.cpp(49) : error C2106: '=' : left operand must be l-value
e:\microsoft visual studio\myprojects\1314\1111.cpp(49) : error C2440: '=' : cannot convert from 'bool' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
执行 cl.exe 时出错.
1111.obj - 1 error(s), 0 warning(s)
编译了一下,满满的错误。。
#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;
-------------------->x22没有初始化。好像不知道你要做什么,暂且改成x22=0.0吧
char *name,*chat;
------------------------------------>*name这个好像没用到啊。没用到就删掉它吧。
if((fp=fopen(c:"key.dxf","w"))==NULL)---------> 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")------------->if(chat=
="ENTITIES"||chat=
="entities")
for(i=1;i<=2;i++)
{
fscanf(fp,"%s",chat);
if(chat="LINE"||chat="line")------------> 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")--------->if(chat=
="ENDSEC"||chat=
="endsec")
fscanf(fp,"%s",chat);
if(chat="EOF"||chat="eof")----------->if(chat=
="EOF"||chat=
="eof")
exit(1);
fclose(fp);
}
找到的就改了这么多,其实我也搞不懂你的代码。dxf后缀的文件是CAD格式的。。。。