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
Const question
Const question
May 1, 2012 at 9:20pm UTC
jag4205
(20)
Are the following statements valid? Why?
const int m =200;
const int * q = &m;
++(*q);
++q;
May 1, 2012 at 9:27pm UTC
guestgulkan
(2942)
What do you think and why?
May 1, 2012 at 9:28pm UTC
jag4205
(20)
No, but i'm not sure why. That's why i am asking
May 1, 2012 at 9:33pm UTC
Peter87
(11234)
What do you think const means?
May 1, 2012 at 9:34pm UTC
jag4205
(20)
const allows you to specify whether or not a variable is modifiable.
May 1, 2012 at 9:36pm UTC
Pter0dactyl
(196)
actually 'constant' is a key word which tells the compiler that the value ain't gonna change throughout the run of program. and if you try to change it forcefully,
"It flashes an error."
Topic archived. No new replies allowed.