difference between const/nonconst function that return a pointer

Jan 17, 2013 at 7:29pm
hello.

Im reading c++ primer+ six edition by stephen prata, im at page 366.

I want to ask what is the difference between these two functions that return a pointer if the definition is the same:

1
2
const double* f1(double x);
double* f2(double x);
Jan 17, 2013 at 7:36pm
The qualifier const means that you may not modify the data refrenced to by the pointer.
Last edited on Jan 17, 2013 at 7:37pm
Jan 17, 2013 at 7:38pm
ahh yes, i see... its just kinda confusing sometimes because he used pointers to point to pointerfunctions.

but thanks for help
Topic archived. No new replies allowed.