Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int foo()
  4. {
  5. return 42;
  6. }
  7.  
  8. int main(void) {
  9. const int g = foo(); // OK
  10. printf("%dn", g);
  11. // g = foo();; <-- will cause compile error : assignment of read-only variable ‘g’
  12. return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement