Advertisement
math230

Pointer math

Sep 6th, 2019
593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.20 KB | None | 0 0
  1. int main(){
  2.   int num=8, x=53, *xp;
  3.  
  4.   int*  xp;
  5.   xp = &x;
  6.   num = *xp;
  7.  
  8.   //Pointer arithmetic
  9.     printf("%p %p", xp, xp + 2);
  10.   // &x = 0c, &x+2=0x14 (8 bytes added)
  11.    
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement