Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 27th, 2013  |  syntax: None  |  size: 0.26 KB  |  views: 28  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <stdio.h>
  2.  
  3. static const int a = 3;          // I promise I won't change a
  4.  
  5. int main(void)
  6. {
  7.     const int *ptr_to_a = &a; // I still promise I won't change a
  8.     int *ptr;
  9.     ptr = ptr_to_a;
  10.     *ptr = 5;
  11.  
  12.     printf("%d\n", a);
  13.  
  14.     return 0;
  15. }
clone this paste RAW Paste Data