//const2.cpp

int i1;			//ok - i1 declared with undefined value
int i2 = 0;		//ok - i2 - declared with value 0
const int c1;		//error - no value supplied for const
const int c2 = 2;	//ok - c2 declared forever as having value 2
int *ip1;		//ok - ip1 uninitialized
int *ip2 = &i2;		//ok - ip2 now points to our i2 with value 0
int *ip3 = &c2;		//error - non-const pointer & const value
const int* cp1;		//ok
const int* cp2 = &i2;	//ok
const int* cp3 = &c2;	//ok
int* const ipc1;	//error - const pointer to non-const value
				//uninitialized
int *const ipc2 = &i2;	//ok - const pointer to non-const value
				//supplied non-const value to reference
int *const ipc3 = &c2;	//error - must reference non-const value
const int* const cpc1;	//error - const pointer uninitailized
const int* const cpc2 =	&i2;	//ok
const int* const cpc3 =	&c2;	//ok

main()	{
   int i=1;	const int ic = 1;
   i2 = 1;	//ok
   c2 = 1;	//error - cannot reassign constr value
   ip1 = &i;	//ok
   ip2 = &ic;	//error - cannot point to const value
   cp1 = &i;	//ok
   cp1 = &ic;	//ok
   ipc2 = &i;	//error - const pointer reference
   ipc2 = &ic;	//error - const pointer reference
   cpc2 = &i;	//error - const pointer reference
   cpc2 = &ic;	//error - const pointer reference
}

//end const2.cpp

