Better yet:
If SDL_Init() returns a negative value, an error occurred.if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO) < 0 ) { fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError()); exit(1); }
The function SDL_GetError() returns a string containing a message that you can print out, which explains the error.