Go to the first, previous, next, last section, table of contents.


swab

Syntax

#include <stdlib.h>

void swab(const void *from, void *to, int nbytes);

Description

This function copies nbytes bytes from the address pointed to by from to the address pointed by to, exchanging adjacent even and odd bytes. It is useful for carrying binary data between little-endian and big-endian machines. The argument nbytes should be even, and the buffers from and to should not overlap.

Return Value

None.

Portability

not ANSI, not POSIX


Go to the first, previous, next, last section, table of contents.