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
assigning const var to ref var's
assigning const var to ref var's
Aug 6, 2011 at 5:20am UTC
baddy11
(1)
const int i=10;
int &j=i;
Is this assignment correct.?
Aug 6, 2011 at 7:29am UTC
hamsterman
(4538)
You could just compile and see..
It is not correct as constness is lost.
It should be
const
int
& j = i;
Topic archived. No new replies allowed.