|
阅读:898回复:1
高手来解决 读取E00文件的程序的问题啊
<P>readARCSection (FILE *archivo, strArcInfo *arcinfo, int precision)<BR>{<BR> int v2, v3, v4, v5, v6, num_coor;</P>
<P> printf ("%s\r", msgReadingARC);<BR> while (!feof (archivo))<BR> {<BR> fgets (linea, 128, archivo);<BR> sscanf (linea, "%i %i %i %i %i %i %i", ;id, ;v2, ;v3, ;v4, ;v5, ;v6, ;num_coor);</P> <P> if (id == -1)<BR> {<BR> printf ("%s[DONE]\n", msgReadingARC);<BR> return;<BR> }</P> <P> arcinfo->arcs = realloc (arcinfo->arcs, (arcinfo->arcsCount + 1) * sizeof (shapeArcObject));</P> <P> arcinfo->arcs[arcinfo->arcsCount].id = id;<BR> arcinfo->arcs[arcinfo->arcsCount].elements = num_coor;<BR> arcinfo->arcs[arcinfo->arcsCount].x = malloc (num_coor * sizeof (double));<BR> arcinfo->arcs[arcinfo->arcsCount].y = malloc (num_coor * sizeof (double));</P> <P> if (precision == 2)<BR> readSinglePrecision (archivo, num_coor,<BR> arcinfo->arcs[arcinfo->arcsCount].x, arcinfo->arcs[arcinfo->arcsCount].y);<BR> else if (precision == 3)<BR> readDoublePrecision (archivo, num_coor,<BR> arcinfo->arcs[arcinfo->arcsCount].x, arcinfo->arcs[arcinfo->arcsCount].y);<BR> else<BR> exit (1);</P> <P> arcinfo->arcsCount++;<BR> }</P> <P> printf ("%s[FAIL]\n", msgReadingARC);<BR>}<BR></P> <P>这段代码是读取E00文件的 一部分 那位了解E00文件格式高手帮我解释解释这段程序啊</P> |
|
|
1楼#
发布于:2007-08-07 20:50
<P>你看看E00格式的说明</P>
<P>本论坛可以搜索到</P> <P>我写过txt转换E00的程序,关键你认识E00格式后就是写txt一样了</P> |
|
|