Advertisement
Xisepe

swap

Dec 3rd, 2021
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. void swap(void* a, void*b, int size) {
  2.     int i = 0;
  3.     while(i < size) {
  4.         char tmp = *((char*)b + i);
  5.         *((char*)b + i) = *((char*)a + i);
  6.         *((char*)a + i) = tmp;
  7.         i++;
  8.     }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement