Object3DS* pObject;
It allocates memory during the program
*( &Model3ds.pObject + (Model3ds.numOfObjects-1)*sizeof(Object3DS) ) = new(Object3DS);
VC++ problem
Read these topics:
http://www.gamedev.net/community/forums/topic.asp?topic_id=91589
http://www.gamedev.net/community/forums/topic.asp?topic_id=90281
http://www.gamedev.net/community/forums/topic.asp?topic_id=91589
http://www.gamedev.net/community/forums/topic.asp?topic_id=90281
That is what you are doing wrong. Object3DS* can hold a pointer to a Object3DS array or a single Object3DS object. It cannot hold an array of Object3DS pointers.
If you do like this:
Object3DS* pObject = new Object3DS[100];
That array will hold 100 Object3DS objects. Then you could memset the entire array, by:
memset(pObject, 0, 100 * sizeof(Object3DS));
If you do like this:
Object3DS* pObject = new Object3DS[100];
That array will hold 100 Object3DS objects. Then you could memset the entire array, by:
memset(pObject, 0, 100 * sizeof(Object3DS));
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement