Jump to content
  • Advertisement
Sign in to follow this  
Show

help: unhandled exception error

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

void DR::DrawScene() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glTranslatef(-11.0f, 9.0f,-35.0f); char tile(' '); vector<char> haha; haha = map.CurrentMap(); tile = haha[0]; } map.CurrentMap() returns a vector<char> value. I'm using VC++ .NET 2003. In debug mode, I keep getting the following error at the 'tile = haha[0]' line. Unhandled exception at 0x0041e489 in DR.exe: 0xC0000005: Access violation reading location 0x00000000. What's wrong with my code? The program seems to run fine if I just click the .exe file.

Share this post


Link to post
Share on other sites
Advertisement
Sounds like you have different "current directories" for running within the IDE and just from clicking on the exe.

You are probably loading a file with a relative path, so map.CurrentMap() is failing and "haha" is staying at size=0 which means haha[0] is out-of-bounds.

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!