_swab
Visual Studio 2005
Swaps bytes.
void _swab( char *src, char *dest, int n );
Parameters
- src
-
Data to be copied and swapped.
- dest
-
Storage location for swapped data.
- n
-
Number of bytes to be copied and swapped.
| Routine | Required header | Compatibility |
|---|---|---|
| _swab | <stdlib.h> | Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 |
For additional compatibility information, see Compatibility in the Introduction.
// crt_swab.c
#include <stdlib.h>
#include <stdio.h>
char from[] = "BADCFEHGJILKNMPORQTSVUXWZY";
char to[] = "..........................";
int main()
{
printf( "Before: %s\n %s\n\n", from, to );
_swab( from, to, sizeof( from ) );
printf( "After: %s\n %s\n\n", from, to );
}
Output
Before: BADCFEHGJILKNMPORQTSVUXWZY
..........................
After: BADCFEHGJILKNMPORQTSVUXWZY
ABCDEFGHIJKLMNOPQRSTUVWXYZ Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.