Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript Site
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc

   Amazon

   Links

    


Reverse a string
 

 

Description

Someone asked how to reverse a string in C . Here is an example using the strrev() function

Code

/**************************************
reverse a string example using strrev()
function
***************************************/
#include <stdio.h>
#include <string.h>

int main(void)
{
char msg[50] = "programmershelp string reverse";
char *reversed;
printf("Here is the first string : %s\n",msg);
reversed = strrev(msg);
printf("here is the reversed string : %s\n",reversed);

return 0;
}

Information

tested using Visual C++ 6

 

 

 

 

Download

strrev.txt


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
Usable Screen percentage(Javascript)
an explode function example(php)
Add to favorites script(Javascript)
increase / decrease number with a button press(Javascript)
Is a number odd or even(C Sharp)
diagonal gradient(VB)
use a process to open a fie in notepad(VB.net)
Beep the speaker(C)

    




Copyright © 2003 by programmershelp.co.uk