Translations:Development/Tutorials/Common Programming Mistakes/35/en: Difference between revisions
(Importing a new version from external source) |
(No difference)
|
Latest revision as of 07:31, 26 October 2019
If defining a constant array do not use a pointer as data type. Instead use the data type and append the array symbol with undefined length, [], behind the name. Otherwise you also define a variable to some const data. That variable could mistakenly be assigned a new pointer to, without the compiler complaining about. And accessing the array would have one indirection, because first the value of the variable needs to be read.