Next Previous Contents

## 3.8 _swap

> Function

>   Swap the contents of memory areas.

> Header

>   `stdlib.h`

> Declaration

>   `void __fastcall__ _swap (void* p, void* q, size_t size);`

> Description

>   `_swap` will swap (exchange) the contents of the two memory areas pointed to by `p` and `q`. Both memory areas are assumed to be `size` bytes in size.

> Limits

>   - The memory areas may not overlap, otherwise the results are undefined.
>   - The function is only available as fastcall function, so it may only be used in presence of a prototype.
> Availability

>   cc65

> See also

>   memcpy, memmove

> Example

>   None.

Next Previous Contents