Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this noncompliant code example, a decimal constant is mistakenly prefaced with zeros so that all the constants are a fixed length.

Code Block
bgColor#FFCCCC
langc
i_array[0] = 2719;
i_array[1] = 4435;
i_array[2] = 0042;

...

To avoid using wrong values and make the code more readable, don't preface constants with zeroes if the value is meant to be decimal.

Code Block
bgColor#CCCCFF
langc
i_array[0] = 2719;
i_array[1] = 4435;
i_array[2] =   42;

...