Wiki Page Content

Differences between revisions 8 and 10 (spanning 2 versions)
Revision 8 as of 2010-08-27 21:57:59
Size: 1121
Editor: SheenaSmith
Comment: update content (old wiki)
Revision 10 as of 2010-08-29 19:14:15
Size: 783
Editor: Sam Lantinga
Comment: null
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
||<tablewidth="100%" style="color: #FF0000;" :> DRAFT||
Line 24: Line 23:
*<<BR>><<Color2(green,Should this old wiki example be included here?)>>
Line 26: Line 25:
#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());
}
}}}<<BR>>*
SDL_SetError("Something unexpected happened: Error Code %d", -37);
}}}
Line 41: Line 32:
 .[[SDL_ClearError]] *
 .[[SDL_GetError]] *
 .[[SDL_ClearError]]
 .[[SDL_GetError]]

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!");

SDL_SetError("Something unexpected happened: Error Code %d", -37);

Remarks

You can add useful comments here


CategoryAPI, CategoryError

None: SDL_SetError (last edited 2016-05-11 20:22:50 by PhilippWiesemann)

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