Guest User

Const is not constant

a guest
May 9th, 2016
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. void main() {
  4.   const int is_this_really_a_constant = 1;  
  5.   int *not_so = &is_this_really_a_constant;
  6.   *not_so = 0;
  7.   if (is_this_really_a_constant) {
  8.       puts("const really means constant");
  9.   } else {
  10.       puts("const means read-only");
  11.   }
  12. }
Add Comment
Please, Sign In to add comment