Sign in to follow this  

Unhandled exception when resizing vector

This topic is 4344 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
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 topic is 4344 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this