Advertisement
cwchen

[C] Pointer to interger

Aug 27th, 2017
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.19 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.     int n = 5;
  5.  
  6.     // Get the address of n
  7.     int* n_ptr = &n;
  8.  
  9.     // Dereference n_ptr to get n
  10.     printf("%d\n", *n_ptr);
  11.  
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement