|
Size: 646
Comment: Added a simple example with no parameters.
|
Size: 1121
Comment: update content (old wiki)
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| ||<tablewidth="100%" style="color: #FF0000;" :> DRAFT|| | |
| Line 23: | Line 24: |
| *<<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 28: | Line 41: |
| .[[SDL_ClearError]] * .[[SDL_GetError]] * |
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
