#149008 - Rajveer - Sun Jan 13, 2008 3:13 pm
I have a struct
The pointer TimestampArray will point to an array of u16 of size SizeOfArray. When creating the array that TimestampArray points to, instead of doing
I want to replace u16 with the type of TimestampArray, so would I do
even though TimestampArray is a pointer?
Code: |
struct ObjModelCollision
{ //blahblah; u16* TimestampArray; //blahblah; }; struct ObjModelCollision* ModelColl = malloc(sizeof(struct ObjModelCollision)); |
The pointer TimestampArray will point to an array of u16 of size SizeOfArray. When creating the array that TimestampArray points to, instead of doing
Code: |
ModelColl->TimestampArray = malloc(sizeof(u16)*SizeOfArray); |
I want to replace u16 with the type of TimestampArray, so would I do
Code: |
ModelColl->TimestampArray = malloc(sizeof(ModelColl->TimestampArray)*SizeOfArray); |
even though TimestampArray is a pointer?