SHARE
TWEET

Untitled

a guest Mar 27th, 2013 31 Never
  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. }
RAW Paste Data
Top