知识点5:神奇数字(magic number)

知识点5:神奇数字(magic number)_第1张图片

watch out! Don't put a semicolon at the end of your #defines.

You'll notice here also that I frequently #define all my defined symbolic constants, so to speak, are always in all caps.

It's a convention. It's not required.

The reason generally people will use all capitals when they're #defining is just to make it really clear that this particular element of my code is a defined constant. If it was lowercase, it's possible that it might be confused with a variable. And that's probably not a good thing to do.

你可能感兴趣的:(知识点5:神奇数字(magic number))