Advertisement
thenewboston

C Programming Tutorial - 43 - Dereference Pointer

Aug 22nd, 2014
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ctype.h>
  4. #include <string.h>
  5. #include <math.h>
  6.  
  7. int main()
  8. {
  9.     int tuna = 19;
  10.     int * pTuna = &tuna;
  11.  
  12.     printf("Address \t Name \t Value \n");
  13.     printf("%p \t %s \t %d \n", pTuna, "tuna", tuna);
  14.     printf("%p \t %s \t %p \n", &pTuna, "pTuna", pTuna);
  15.  
  16.     printf("\n*pTuna: %d \n", *pTuna);
  17.  
  18.     *pTuna = 71;
  19.  
  20.     printf("\n*pTuna: %d \n", *pTuna);
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement