(This is the documentation for SDL3, which is under heavy development and the API is changing! SDL2 is the current stable version!)

SDL_ClearError

Clear any previous error message for this thread.

Header File

Defined in <SDL3/SDL_error.h>

Syntax

int SDL_ClearError(void);

Return Value

Returns 0

Version

This function is available since SDL 3.0.0.

Code Examples

const char *error = SDL_GetError();
if (*error) {
  SDL_Log("SDL error: %s", error);
  SDL_ClearError();
}

See Also


CategoryAPI, CategoryAPIFunction, CategoryError