strrev3pub
Reverse a string in place
Usage
#include <publib.h> char *strrev(char *str);
Overview
strrev reverses the argument string in place, i.e., it swaps the ith character from the beginning with the ith character from the end.
Return value
strrev returns its argument.
Examples
Reversing "dlrow, elloh" would be done like the following.
char str[] = "dlrow, elloh"; puts(strrev(str));
This would output "hello, world". Note that using the string literal as the argument would be an error, since it is not allowable to modify string literals.
Releases
16 releases since Debian 1.2 (Rex); the text changed 4 times.