this code works fine :
Code: Select all
SPhysxAndNodePair* mag;
"some where in main()"
mag = new SPhysxAndNodePair[999];
for(int i=0;i<20;i++)
{
for(int j=0;j<20;j++)
{
cout<<"test1";
mag[id].PhysxObject = physxManager->createSphereObject(core::vector3df(i*tilesize,j*tilesize,z*tilesize), core::vector3df(0,0,0), tilesize/2, 1.0f, NULL);
cout<<"test 2 \n";
mag[id].SceneNode = smgr->addAnimatedMeshSceneNode(smgr->getMesh("par.3ds"));
mag[id].SceneNode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
mag[id].SceneNode->setMaterialFlag(EMF_LIGHTING, false);
}}
but when i change
Code: Select all
SPhysxAndNodePair* mag;Code: Select all
SPhysxAndNodePair mag[999];Code: Select all
mag = new SPhysxAndNodePair[999];but when theprogram is excuted it doesnt stop , you willfind in the code to output to the console which are
"test1" and "test 2"
only text1 appears that means that the program stops at this line:
Code: Select all
mag[id].PhysxObject = physxManager->createSphereObject(core::vector3df(i*tilesize,j*tilesize,z*tilesize), core::vector3df(0,0,0), tilesize/2, 1.0f, NULL)like for example:
Code: Select all
int array[99]Code: Select all
int*array=new int[99]any help?