Why is this class tutorial so obsessed with const? | Sololearn: Learn to code for FREE!
0

Why is this class tutorial so obsessed with const?

If you want to disallow a class member variable from changing value, you just offer a get function and not a put function.

15th Dec 2016, 2:41 PM
iGaviotis
iGaviotis - avatar
1 Odpowiedź
+ 1
I think using const will save memory.
26th Dec 2016, 7:55 PM
Adam Blažek
Adam Blažek - avatar