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

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.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,789评论 0 23
  • 永远是落伍者! 2008-03-08 08:19 阅读(169)评论(59) 忽然想到一个说不上悲哀的问题,就是我...
    零星往事阅读 187评论 0 0
  • 有时也会有江南的烟雨 落入蜀地的江湖 微凉的夜里 我仿佛听到 一个失心的女子 在花园里哀怨地唤着 周郎啊——周郎 ...
    郑小红阅读 495评论 0 0
  • UITableView : 一、注意方法实现顺序, table.tableFooterView 或者 table....
    CoderBigBear阅读 137评论 0 0
  • 越发觉得,这世间所有的心烦意乱都来自欲求不满。 让我暂且将这世俗浮云都抛开,在清润的细雨中,就这样静静地走着,雾气...
    平静地平凡阅读 297评论 2 2