/ ******************************************************************* * * 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/9/17 17:30,
18.217.10.160: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? <A HREF="http://sxlist.com/TECHREF/language/ccpp/cref/EXAMPLES/const2.c"> language ccpp cref EXAMPLES const2</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.