GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
STRREV(3) C Programmer's Manual STRREV(3)

strrev - reverse a string in place

#include <publib.h>
char *strrev(char *str);

strrev reverses the argument string in place, i.e., it swaps the ith character from the beginning with the ith character from the end.

strrev returns its argument.

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.

Does not automatically detect palindromes, nor automatically return without doing anything.

publib(3), memrev(3)

Lars Wirzenius (lars.wirzenius@helsinki.fi)
C Programmer's Manual Publib

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.