nikolas_serafini

Lista 8 - Exercício 8

Aug 11th, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. void reverseString(char *s) {
  2.     int i;
  3.     char temp,*begin = s,*end = s + strlen(s) -1 ;
  4.  
  5.     for (i = 0 ; i < strlen(s)/2 ; i++ ) {
  6.         temp = *begin;
  7.         *begin = *end;
  8.         *end = temp;
  9.         begin++;
  10.         end--;
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment