SDL_SetError

Name

SDL_SetError -- sets the SDL error to a formatted string.

Synopsis

#include "SDL_error.h"

void SDL_SetError (const char *fmt, ...);

Description

SDL_SetError sets the SDL error to a printf style formatted string.

Return Value

Returns nothing.

Example

#include "SDL_error.h"

int main()      {
        char buffer[BUFSIZ+1];
        SDL_memset(buffer, '1', BUFSIZ);
        buffer[BUFSIZ] = 0;
        SDL_SetError("This is the error: %s (%f)", buffer, 1.0);
        printf("Error 1: %s\n", SDL_GetError());
}

See Also

SDL_Error, SDL_GetErrorMsg, SDL_GetError, SDL_ClearError


CategorySDLGeneral

SDL_SetError (last edited 2008-12-11 09:25:54 by KenBull)