P
Podrzut_z_Laweczki
Hello everyone, I have a question:
const double zaq = 1.23;
const double *ptcd = &zaq;
double *ptd;
ptd = const_cast<double*>(ptcd);
*ptd = 5.67;
cout<<zaq<<endl;
It's only an exercise. I tried that in VS.NET 2003 and it seems to work
only with floating point types. I know it's not the best way, but I'm
just curious why this example doesn't work for other types.
const double zaq = 1.23;
const double *ptcd = &zaq;
double *ptd;
ptd = const_cast<double*>(ptcd);
*ptd = 5.67;
cout<<zaq<<endl;
It's only an exercise. I tried that in VS.NET 2003 and it seems to work
only with floating point types. I know it's not the best way, but I'm
just curious why this example doesn't work for other types.