---
name: "wnswap"
section: "3"
platform: "linux"
package: "libwn-dev"
version: "6.0-17"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/wnswap"
---

# wnswap(3)

swap 2 variables

## NAME

wn\_swap - swap 2 variables

## SYNOPSIS

```
#include <wn/wnswap.h>

wn_swap(a,b,type)
```

## DESCRIPTION

**wn\_swap** is a macro which swaps *a* and *b*.   *a* and *b* must be of type *type*.  *type* is used to declare a temporary.

## EXAMPLES

```
{
int a,b;
wn_swap(a,b,int);
}
{
ptr p1,p2;
wn_swap(p1,p2,ptr);
}
{
char *p1,*p2;
wn_swap(p1,p2,char *);
}
```

## SEE ALSO

wnsort

## AUTHOR

Will Naylor
