Float confusion

Are the following statements valid? Why?

float f = 10.0;

const float *pf = &f;

f++;

(*pf)++;
Just try to compile them; the compiler will tell you.
I tried and I get an error. I want to know why though
the last statement ie

(*pf)++;

will not do 'cuz its a constant value and constants cannot be changed.
Thanks, you made it clear to understand :)
hey champ, do u have link for a good c++ book to read. if yes please inform me. i'm a beginner too...
Try reading Introduction to programming with C++
Topic archived. No new replies allowed.