Const Syntax

The omission of const correctness in code is a big pet peeve of mine.

Quick, what’s the difference between:

and:

?

Unfortunately, the former lets you modify the strings in the CONST_STRING_TABLE:

while the latter doesn’t (which is probably what you wanted), generating a compiler error instead. But I know I’ve seen the former plenty of times when reading through peoples’ code. That, along with the following, drive me up the wall whenever I run into them.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.