How to reverse a string

void ReverseString(char * String) {
  char * Begin = String;
  char * End = String + strlen(String) - 1;
  char TempChar = '
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--;
}
}
'; while (Begin < End) { TempChar = * Begin; * Begin = * End; * End = TempChar; Begin++; End--; } }
Chitra
Chitra

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in