Main Menu

HOME

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

Make money selling software. Check this out here

Hosted clickbank mall. Check this out here




   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
Yahoo news(PHP)
flashing status bar message(Javascript)
updating clock(PHP)
Basic currency conversion(PHP)
gethostbyname function(PHP)
hello world(GameBoy)
split a file into path info(php)
Uphill text example(Javascript)

    




Copyright © 2003 by programmershelp.co.uk