Pages

Friday, September 16, 2011

Confused Constants : C and C++


Following code is erroneous in C++ and is works fine in C (with warning)

int *p;
const int i =3;
p = &i;


trying to point out a non constant pointer to a constant variable. 


No comments:

Post a Comment