将引发错误的指针,我不知道知道为什么:访问的结构是在结构
physics.c:74: error: incompatible types in initialization
typedef struct gameBody gameBody;
struct gameBody
{
cpBody *body;
int numberOfShapes;
cpShape *arrayOfShapes; //This stores an array of pointers to Shapes
};
//Struct that stores the cpSpace object and the array of pointers to the body objects
typedef struct gameSpace gameSpace;
struct gameSpace
{
cpSpace *space;
int numberOfObjects;
gameBody *arrayOfObjects; //This stores an array of gameBodys
};
for(int i = 0; i < space -> numberOfObjects; i++)
{
//body info
gameBody *gBody = space -> arrayOfObjects[i];
}
和..该行是? – 2013-02-17 08:55:43
您在25分钟内重复发布相同的问题! – 2013-02-17 09:00:42
而不是发布每个不同编译器错误的问题,请执行此操作。 1.发表问题。 2.阅读并理解答案。 3.使用这种理解来修复代码中的多个相同的错误。 4.如果没有先检查是否与20分钟前发布的问题完全相同,请不要发布新问题! – 2013-02-17 09:03:21