Advertisement
hocikto19

Revert string recursively

Jun 6th, 2015
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.20 KB | None | 0 0
  1. void obrat(char *x, int zaciatok, int koniec){
  2.    char pom;
  3.    if(zaciatok>=koniec)
  4.       return;
  5.    pom=x[zaciatok];
  6.    x[zaciatok]=x[koniec];
  7.    x[koniec]=pom;
  8.    obrat(x, zaciatok+1, koniec-1);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement