### Author Topic: struct failed in arx???  (Read 2911 times)

0 Members and 1 Guest are viewing this topic.

#### frtfff

• Bull Frog
• Posts: 226
##### struct failed in arx???
« on: May 04, 2013, 11:34:34 AM »
Code: [Select]
`// 类型定义-------------------------------------------------typedef struct VERTEX2D_TYP //二维点{ double x; double y; /* double z;*/} VERTEX2D, *VERTEX2D_PTR;typedef struct EDGE_TYP //边{ VERTEX2D v1; VERTEX2D v2;} EDGE, *EDGE_PTR;typedef struct TRIANGLE_TYP //三角形{ int i1; // vertex index int i2; int i3; TRIANGLE_TYP* pNext; TRIANGLE_TYP* pPrev;} TRIANGLE, *TRIANGLE_PTR;typedef struct MESH_TYP //三角网{ int vertex_num; int triangle_num; VERTEX2D_PTR pVerArr; // 指向构成三角网的点集 TRIANGLE_PTR pTriArr; // 指向投诚三角网的三角形集合} MESH, *MESH_PTR;// AcGePoint3d pt = pPnt->position(); ((VERTEX2D_PTR)(mesh->pVerArr +i+3))->x = pt.x; ((VERTEX2D_PTR)(mesh->pVerArr +i+3))->y =  pt.y;[code]this is failed When I try to compile this code in arx,  ???acad.exe 中的 0x10017e08 (triLowSon.arx) 处未处理的异常: 0xC0000005: 读取位置 0x00000008 时发生访问冲突`

#### owenwengerd

• Bull Frog
• Posts: 440
##### Re: struct failed in arx???
« Reply #1 on: May 04, 2013, 03:50:15 PM »
Your code is incomplete. I recommend to remove all type casts so the compiler can help you find the problems with your code.