Thanks for advice and I am sorry about the typo
actually the correct one in class B should be
Code: Select all
B::B(){
...
description = new string[n];
...
}
However, the main problem we have encountered is the error Privileged instruction, Illegal Instruction, access violation etc. when the program change from one scene to and other.
I have tried to find out the problem but I still can't find it.
Actually the file reading part should be correct since the data is loaded correct and can be used in the game if I don't change scene. But when I change to another scene, the program encountered those exception. After I have removed those dynamic arrays and not loading those data, the program run without errors. I don't know why the program crash and it always crash after loading the scene data like this.
Code: Select all
A::A(IrrlichtDevice *_device){
smgr = _device->getSceneManager();
driver = _device->getVideoDriver();
env = _device->getGUIEnvironment();
smgr->loadScene("scene.irr");
player = smgr->addAnimatedMeshSceneNode(smgr->getMesh("player.3ds"), 0, 1, vector3df(0,0,0), vector3df(0,0,0), vector3df(1,1,1), false);
...
}
And the exception cause the program break before adding the animated mesh.