April 2017
Beginner to intermediate
394 pages
9h 16m
English
Using const is another area of programming that seems to be a little controversial. Some programmers argue that they have never had a bug where using const would have helped. Others feel that, since you can't guarantee that a const object won't be modified, it is completely worthless. The fact is that const objects can be modified. const is not magic. So, is const correctness still a good thing? Before we get into that, let's have a look at what const is.
When you create a const variable, you must initialize it. All const variables will be checked at compile time to make sure that the variable is never assigned a new value. Since it happens at compile time, it doesn't have an influence ...
Read now
Unlock full access