daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. char Str_mirror(char *napis)
  3. {
  4.     char tmp, *start = napis;
  5.     int length = 0;
  6.     for(int i = 0; *(napis+i) != '\0'; i++) length++;
  7.     char *end = napis+length - 1;
  8.     while(end > start)
  9.     {
  10.         tmp = *start;
  11.         *start = *end;
  12.         *end = tmp;
  13.         start++;
  14.         end--;
  15.     }
  16. }
  17. int main()
  18. {
  19.     char text[]="ala ma kota.";
  20.     Str_mirror(text);
  21.     for(int i = 0; text[i] != '\0'; i++)
  22.         printf("%c", text[i]);
  23.     return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top