Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Bashar TeG

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

This topic is 5408 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!