Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4 |
both |
#define _XOPEN_SOURCE
#include <unistd.h>
void swab(const void *__restrict__src, void *__restrict__dest, ssize_t nbytes);
The swab() function copies nbytes bytes, which are pointed to by src to the object pointed to by dest, exchanging adjacent bytes. The nbytes argument should be even. If nbytes is odd, swab() copies and exchanges nbytes-1 bytes and the disposition of the last byte is left unchanged in the target area. If nbytes is zero or negative, no copying is performed.
swab() returns no values.