please dont rip this site

Language Ccpp Cref Examples CONST2.C

/ *******************************************************************
 * Purpose: 'const' example. This code shows that making a
 *          variable 'const' only tells the compiler to not
 *          allow reassignment of the variable. The data is not
 *          in a special location, it can still be altered.
 *          This code may cause compiler warning messages
 *          but will compile and run.
 * Author:  M J Leslie.
 * Date:    03-Mar-97

  const int  Men   = 10;
  int       *Women = &Men;

  *Women = 20;

  printf("There are %d men\n", Men);

 * Result.
 * There are 20 men

file: /Techref/language/ccpp/cref/EXAMPLES/const2.c, 0KB, , updated: 1997/4/21 09:52, local time: 2023/9/29 05:28,

 ©2023 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> language ccpp cref EXAMPLES const2</A>

Did you find what you needed?


Welcome to!


Welcome to!