strrev, fstrrev
raw OCR
Reverses a string.
Defined in header <string.h>
Syntax
#include <string.h>
Near version: char *strrev(char *s);
Far version: char far * far fstrrev(char far *s)
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ |
Remarks
strrev changes all characters in a string to reverse order, except the terminating null character. (For example, it would change string\0 to gnirts\0.)
Return value
strrev returns a pointer to the reversed string.
Example
#include <string.h>
#include <stdio.h>
int main(void)
{
char *forward = "string";
printf("Before strrevO: %s\n", forward);
strrev(forward) ;
printf("After StrrevO : %s\n", forward);
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/string.h/strrev/
· short form /3.1/strrev/