cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
T/F
T/F
Dec 16, 2012 at 7:43pm UTC
jlillie89
(403)
1.Global constants have no side effects in a program?
T/F and please explain.Thank you.
Dec 17, 2012 at 8:26am UTC
HoneyBoy
(11)
False
http://en.wikipedia.org/wiki/Global_variable
Dec 17, 2012 at 8:28am UTC
Athar
(4466)
A constant is not a variable.
Only functions can have side effects.
Dec 17, 2012 at 8:36am UTC
HoneyBoy
(11)
whoops
Dec 17, 2012 at 12:07pm UTC
Chervil
(7320)
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.