79136426

Date: 2024-10-29 09:03:05
Score: 1
Natty:
Report link

If these values are not constant (and they are dynamic as they are running through a main loop, for example) as it would appear, static const will not allow them to ever be changed. These definitions save memory and errors in cases where the variable does not ever change throughout the life of the program.

Defining these variables as uns does not seem to be appropriate to me in this circumstance. Defining them as unsigned int may save you a few bits in the long run, and int would more than likely suffice. Further, defining the variable in the header and assigning value in the cpp files, as necessary, is better practice. Your errors will disappear, if you follow these few guidelines which are better practice than what you have presented.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: ndtech