首页> 外文期刊>Everyday practical electronics >Max's Cool Beans cunning coding tips and tricks
【24h】

Max's Cool Beans cunning coding tips and tricks

机译:Max的酷豆狡猾的编码提示和技巧

获取原文
获取原文并翻译 | 示例
获取外文期刊封面目录资料

摘要

Before we jump into the fray with gusto and abandon (and aplomb, of course), I was recently chatting with my chum Steve Manley who features so prominently in my main Cool Beans column. I'm not sure how we got into this particular topic, but Steve taught me a very cunning coding trick as follows... It very often happens in my programs that I have an integer variable that I use as a pointer (or index) to a number of elements in an array or some such entity. For example, let's say we have ten elements of something or other numbered from 0 to 9. For clarity in our code and to make it easy to modify in the future, we might define NUM_E ('number of elements') as being 10 and MAX_E ('maximum element') as being 9. (We could also define MIN_E as being 0, but we typically just use 0.)
机译:在我们用Gusto跳进磨损之前(当然,当然),我最近和我的Chum Steve Manley聊天,他们在我的主要酷豆柱中突出了。 我不确定我们如何进入这个特殊的话题,但史蒂夫教我一个非常狡猾的编码技巧如下......它经常发生在我的程序中我有一个我用作指针(或索引)的整数变量 在数组中或某些此类实体中的许多元素。 例如,让我们说我们有十个或其他数量的东西,从0到9.在我们的代码中清楚起见,并使将来很容易修改,我们可能会将num_e('元素'数量')定义为10和 max_e('最大元素')为9.(我们也可以将min_e定义为0,但我们通常只是使用0.)

著录项

  • 来源
    《Everyday practical electronics》 |2021年第7期|66-67|共2页
  • 作者

  • 作者单位
  • 收录信息
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类
  • 关键词

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号