SDL_GetError

Name

SDL_GetError -- Gets SDL error string.

Synopsis

#include "SDL_error.h"

char* SDL_GetError (void);

Description

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

Return Value

Returns a null terminated string which represents the last error. If there has been no error, this function returns an empty string (a string beginning the the character \0). In either case, this string is statically allocated and must not be freed by the user.

Example

   1 if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
   2     printf("SDL_Init failed: %s\n", SDL_GetError());
   3     return 1;
   4 }

See Also

SDL_SetError, SDL_ClearError


CategorySDL13API CategorySDL13APIGeneral

SDL-1.3/SDL_GetError (last edited 2009-07-27 02:18:38 by KenBull)