#pragma section-numbers off #pragma camelcase off = SDL_GetError = Use this function to retrieve a message about the last error that occurred. <> == Syntax == {{{#!highlight cpp const char* SDL_GetError(void) }}} == Return Value == Returns a message with information about the specific error that occurred, or an empty string if there hasn't been an error message set since the last call to [[SDL_ClearError]](). /* Without calling [[SDL_ClearError]](), the */ The message is only applicable when an SDL function has signaled an error. You must check the return values of SDL function calls to determine when to appropriately call [[SDL_GetError]](). == Code Examples == {{{#!highlight cpp if (SDL_Init(SDL_INIT_EVERYTHING) < 0) { // Unrecoverable error, exit here. printf("SDL_Init failed: %s\n", SDL_GetError()); } }}} Note: Although this example uses [[SDL_Init]](), [[SDL_GetError]]() provides an error message for any failed SDL operation which supports error reporting, see the wiki page for each particular SDL function. == Remarks == It is possible for multiple errors to occur before calling [[SDL_GetError]](). Only the last error is returned. The returned string is statically allocated and must not be freed by the application. == Related Functions == .[[SDL_ClearError]] .[[SDL_SetError]] ---- [[CategoryAPI]], [[CategoryError]]