Advertisement
RicardasSim

test

Mar 22nd, 2019
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <limits.h>
  4. #include <stdint.h>
  5.  
  6. void changeVar(int *a);
  7.  
  8. int main(int argc, const char *argv[]) {
  9.     int x = 100;
  10.     printf("x is: %d\n", x);
  11.     changeVar(&x);
  12.     printf("x is: %d\n", x);
  13.  
  14.     return 0;
  15. }
  16.  
  17. void changeVar(int *a)
  18. {
  19.     *a = 20;
  20. }
  21.  
  22. /*
  23. out:
  24.  
  25. x is: 100
  26. x is: 20
  27.  
  28.  
  29. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement