Tutorials, Free Online Tutorials,It Challengers provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, core java, sql, php, c language etc. for beginners and professionals.

Breaking

4. Reverse a string

4. Reverse a string


void ReverseString (char *String)
char *Begin = String;
char *End = String + strlen(String) - 1; char TempChar = '\0';
            while (Begin < End) 
{
TempChar = *Begin;
*Begin = *End;
*End = TempChar;
Begin++;
End--;
}
}

No comments:

Post a Comment