Wiki Page Content

Revision 8 as of 2010-08-27 21:57:59

Clear message

DRAFT

SDL_SetError

Use this function to set the SDL error string.

Syntax

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

Function Parameters

fmt

a printf() style message format string

...

additional parameters matching % tokens in the fmt string, if any

Code Examples

SDL_SetError("Something unexpected happened!");

*
green

#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());
}


*

Remarks

You can add useful comments here


CategoryAPI, CategoryError

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit