0
4

2 に答える 2

0

Assuming that ObjectP is typedeffed to struct Object * (which you haven't mentioned in the question), try this:

table->linkedObjects[i] = *object;

Remember that this will copy the contents of object.

If you don't want this behavior, and you'd like to keep the pointers instead, you should declare the linkedObjects member of your Table struct as Object ** or ObjectP *.

于 2012-12-25T15:06:43.420 に答える
0

If you did the memory allocation with something like malloc(i*sizeof(Object*); and your object is also a pointer to Object, then it should work.

于 2012-12-27T00:10:56.580 に答える