> 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/getportswithstartlimit.md).

# GetPortsWithStartLimit

Retrieve a list of ports starting from start with up to limit elements, according to the current SDK settings.

{% code overflow="wrap" %}

```c
int GetPortsWithStartLimit(unsigned int start, unsigned int limit, uint32_t** outPtr, int* outLen)
```

{% endcode %}

***

## Parameters

* **start**: Starting port.
* **limit**: Maximum number of ports to return.

## Return Value

* int: 0 if success.
* outPtr: Pointer to an array of ports (must be freed with FreeBuf).
* outLen: Number of ports in outPtr.

## Example

```c
// example

uint32_t* out = NULL; 
int n = 0;
GetPortsWithStartLimit(60001, 10, &out, &n);
if (out) {
    for (int i = 0; i < n; i++) {
        printf("Port: %u\n", out[i]);
    }
    FreeBuf(out);
}

```
