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
 *
 *******************************************************************/

main()
{
  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: 2024/4/19 19:46,
TOP NEW HELP FIND: 
3.144.12.205:LOG IN

 ©2024 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="http://www.massmind.org/techref/language/ccpp/cref/EXAMPLES/const2.c"> language ccpp cref EXAMPLES const2</A>

Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to www.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .