// In function tryToModifyArray, "b" cannot be used
// to modify the original array "a" in main.
void
tryToModifyArray(
const
int
b[] )
{
b[
0
] /=
2
;
// error
b[
1
] /=
2
;
// error
b[
2
] /=
2
;
// error
}
// end function tryToModifyArray
d:\cpphtp4_examples\ch04\Fig04_15.cpp(26) : error C2166:
l-value specifies const object
d:\cpphtp4_examples\ch04\Fig04_15.cpp(27) : error C2166:
l-value specifies const object
d:\cpphtp4_examples\ch04\Fig04_15.cpp(28) : error C2166:
l-value specifies const object