SDL_GetError

SDL_GetError -- Gets SDL error string

Syntax

char* SDL_GetError(void);

Description

Returns a null terminated string containing information about the last internal SDL error.

Parameter

nothing

Return value

Returns a null terminated string which represents the last error. This string is statically allocated and must not be freed by the user.

See Also

SDL_SetError

Example

   1 if (SDL_Init( SDL_INIT_EVERYTHING ) == -1) {
   2     // Unrecoverable error, exit here.
   3     printf("SDL_Init failed: %s\n", SDL_GetError());
   4 }

Note : Although this example uses SDL_Init, SDL_GetError provides an error message for any failed SDL operation.

Requirements

Header

SDL.h

Version

1.2.13

Shared object

libSDL.so

DLL

SDL.dll


CategorySDLGeneral

SDL_GetError (last edited 2008-08-14 20:48:37 by NeoNeurone)