Is typecast permanent?

If I have this snip of code:
cout << ps << “ at “ << (int *) ps << endl;

Does it turn the ps pointer into a point-to-int forever or just for that particular output line?
The latter.
A type-cast can be thought of as a translation. In this case you're translating between whatever ps is and an int*, but going with the translation analogy, the translation does not directly change the original text. So... nope!

-Albatross
Topic archived. No new replies allowed.