strrev

Reverses the character order in a string

Local Servers:nonblocking
Remote Servers:N/A
Classification:Other
Service:String Manipulation

Syntax

  #include <string.h>  
   
  char *strrev  ( 
     char   *s1);
  

Parameters

s1
(IN) Points to the string to be replaced.

Return Values

The address of the original string s1 is returned.

Remarks

strrev replaces the string s1 with a string whose characters are in the reverse order.

Example

  #include <string.h>  
   
  char source[ ] = {"A sample STRING"};  
   
  main ()  
  {  
     printf ("%s\n", source);  
     printf ("%s\n", strrev (source) );  
     printf ("%s\n", strrev (source) );  
  }
  

produces the following:

  A sample STRING  
  GNIRTS elpmas A  
  A sample STRING