Skip to main content
GameDev.net gamedev.net
🔒 Locked

[C++] problems with the 'new' operator

Started by Bashar TeG Sep 2, 2003 at 5:39 AM 1 replies 250+ views
Original Post
Bashar TeG
Bashar TeG
Hi. One of my friend, who is new to developpement, ask me to help him to debug his code. He has an access violation on one of his function. One array seems not initialized (address is 0xcccccccc). Then at the begining of the function, I put: tableau_de_layers=new LAYERTAB [1]; //for debugging. The problem is that the address is 0xcccccccc even with this modification. I don''t see where is the problem and I hope you could help me Thanks a lot PS: the source code is available here: http://bashar.miles.teg.free.fr/files/POOLwo2Loader.zip
beehorf
beehorf
I found the problem.

in int CLwo2Loader::NewLayer() function you define
the a local tableau_de_layers variable but Visual C shows the member.

If you remove the line

LAYERTAB* tableau_de_layers= new LAYERTAB [layer_en_cours];

It will ok. Visual C takes all definition to top of the funciton.


be yourself.
Bashar TeG
Bashar TeG

oops. Why did I not find this earlier :D .

Thanks a lot for your help.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.