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

Bashar TeG

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

Recommended Posts

Bashar TeG    122
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:

Share this post

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