MS Visual Studio exeptions, breaks??

I know what errors are, but there are times where after I compile, MS Visual Studio (2010) goes into some wierd mode, the program doesn't show up, but a pop up telling me about a unhandled exception at some hex code and ask me to continue or break. I have no idea what this is or what it means, and I don't know if it counts as an error or something wrong with my code.

This time I was experimenting with SDL and following a tutorial by Lazyfoo, and i've been trying to make a funtion that has all the calls to start SDL in one.
This is the current code:

/*This source code copyrighted by Lazy Foo' Productions (2004-2013)
and may not be redistributed without written permission.*/

----
//Include SDL functions and datatypes
#include "SDL.h"

int zaalstart(int a, int d, int c) // includes all the things to start SDL in one!!
{
int x, y, b;
x =a;
y =d;
b =c;
SDL_Init( SDL_INIT_EVERYTHING );
SDL_Surface* screen = NULL;
screen = SDL_SetVideoMode( x, y, b, SDL_SWSURFACE);
return 0;
}


int main( int argc, char* args[] )
{
//The images
SDL_Surface* hello = NULL;
SDL_Surface* screen = NULL;

zaalstart(640, 460, 32);

hello = SDL_LoadBMP( "hello.bmp" );

SDL_BlitSurface( hello, NULL, screen, NULL );

SDL_Flip( screen );

SDL_Delay( 2000 );

//Free the loaded image
SDL_FreeSurface( hello );

//Quit SDL
SDL_Quit();

return 0;
}

----

And when it goes to the mode I'm talking about, it puts a arrow on the side next to SDL_Flip (screen).

I'd like to know if I'm doing something wrong with my code (I'm starting over in learning again) but I'm more curious about this mode that I'm talking about, and what are you supposed to do when it happens? I bet alot people might know what this is so if you want you can just link me to an explanation if its a big subject. And if my plan on making a function with all those calls is something that can't be done this way, let me know or if theres a more proper way to go around it. Thanks
You're feeding SDL functions NULL values for arguments it expects will not be NULL.

If you want to avoid this "mode" of execution, avoid undefined behavior in your code.

Hint: The screen variable in your zaalstart function is a local variable that stops existing when the function returns that has no relation to the variable of the same name that resides in the main function.
Topic archived. No new replies allowed.