Dec 16, 2012 at 7:43pm UTC
1.Global constants have no side effects in a program?
T/F and please explain.Thank you.
Dec 17, 2012 at 8:26am UTC
Dec 17, 2012 at 8:28am UTC
A constant is not a variable.
Only functions can have side effects.
Dec 17, 2012 at 8:36am UTC
Dec 17, 2012 at 12:07pm UTC
If there is a naming conflict of the global constant with some other object or function, that could be considered a side-effect. Though the local name will take precedence over the global one, it may still be a source of confusion.
Topic archived. No new replies allowed.
General C++ Programming
© cplusplus.com, 2000-2017 - All rights reserved -
Spotted an error? contact us