eg0rmaffin

swap

Jul 4th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void putint(int a)
  4. {
  5.     printf("%i", a);
  6. }
  7.  
  8. int main()
  9. {
  10.     int a;
  11.     int b;
  12.     a = 10;
  13.     b = 20;
  14.     int *pttoa;
  15.     pttoa = &a;
  16.     int *pttob;
  17.     pttob = &b;
  18.    
  19.     int tmp;
  20.     tmp = *pttoa;
  21.     a = b;
  22.     b = tmp;
  23.    
  24.    
  25.    
  26.     putint(a);
  27.     putint(b);
  28.  
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment