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 ответ
+ 1
I think using const will save memory.
26th Dec 2016, 7:55 PM
Adam Blažek
Adam Blažek - avatar