Change const value CPP | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Change const value CPP

I cannot understand this peace of code, here I'm changing the value of a const!! Do I have 2 constant var with the same name? https://code.sololearn.com/c8zy5vrL3VQ6/?ref=app

20th Dec 2017, 9:53 AM
Chob
Chob - avatar
5 Answers
+ 4
@immortal, thank you 😆
20th Dec 2017, 12:32 PM
Chob
Chob - avatar
+ 3
So can I consider them as 2 different variables?
20th Dec 2017, 12:24 PM
Chob
Chob - avatar
+ 3
@Deepak, I did this just before posting the question, they have different addresses
20th Dec 2017, 3:59 PM
Chob
Chob - avatar
0
You do not change constant value, you just create new costant in given scope.
20th Dec 2017, 10:27 AM
Jakub Stasiak
Jakub Stasiak - avatar
0
thanku immortal
20th Dec 2017, 11:48 AM
Hack Erer
Hack Erer - avatar