> For the complete documentation index, see [llms.txt](https://docs.9proxy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.9proxy.com/developers/sdk/sdk-native-c/functions/sdkgetlasterror.md).

# SDKGetLastError

Returns the most recent error message generated by the SDK.

```c
char* SDKGetLastError(void)
```

***

## Parameters

* none

## Return Value

* char\*: Null-terminated error string. The buffer is allocated by the SDK and must be freed with FreeBuf()**.**

## Example

```c
// example

char* e = SDKGetLastError();
if (e) {
    fprintf(stderr, "ERR: %s\n", e);
    FreeBuf(e);
}


```
