Wiki Page Content

Differences between revisions 8 and 9
Revision 8 as of 2010-08-27 21:57:59
Size: 1121
Editor: SheenaSmith
Comment: update content (old wiki)
Revision 9 as of 2010-08-29 19:10:54
Size: 688
Editor: SheenaSmith
Comment: update content (w/ Sam); remove 'draft' note
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?)>>
{{{#!highlight cpp
#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>>*
Line 41: Line 28:
 .[[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!");

Remarks

You can add useful comments here


CategoryAPI, CategoryError

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

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