Jump to content
  • Advertisement
Sign in to follow this  
Mizipzor

Unhandled exception when resizing vector

This topic is 4561 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

I got this line:
W[l].resize((NeuronsInHidden+1)*NeuronsInHidden);
When I step it through, the debugger says l = 1, NeuronsInHidden = 3. I added this line just above it: cout << W.size(); 4 is printed on screen. Still, I get an unhandled exception error at that first line. I shouldnt be accessing anything out of bounds here, what could be the problem?

Share this post


Link to post
Share on other sites
Advertisement
You probably have a buffer overrun in the vector you're resizing which is getting flagged as heap corruption by the runtime library. Check to make sure that you aren't writing outside the vector bound elsewhere in your program.

Share this post


Link to post
Share on other sites
This is in the constructor, can writing outside of boundries later in program caus problems here? Or is it enough to just check the code above it?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!