为什么样两个指针相加没有意义?如何挑选一块合格好使的指针式万用表

发表时间:2018-03-15 20:00:03 作者: 来源: 浏览:

在上一篇文章中,小编为您详细介绍了关于《iPhone5C发热严重?苹果手机开机一直显示一个黑苹果和一个进展条》相关知识。本篇中小编将再为您讲解标题为什么样两个指针相加没有意义?如何挑选一块合格好使的指针式万用表。

Pointer addition is forbidden in C++, you can only subtract two pointers.

The reason for this is that subtracting two pointers gives a logically explainable result - the offset in memory between two pointers. Similarly, you can subtract or add an integral number to/from a pointer, which means \"move the pointer up or down\". Adding a pointer to a pointer is something which is hard to explain. What would the resulting pointner represent?

If by any chance you explicitly need a pointer to a place in memory whose address is the sum of some other two addresses, you can cast the two pointers to int, add ints, and cast back to a pointer. Remember though, that this solution needs huge care about the pointer arithmetic and is something you really should never do.

纯属搬运,哈哈

\", \"extras\": \"\", \"created_time\": ①④⑧⑤④④⑥⑤③⑥ · \"type\": \"answer

编后语:关于《为什么样两个指针相加没有意义?如何挑选一块合格好使的指针式万用表》关于知识就介绍到这里,希望本站内容能让您有所收获,如有疑问可跟帖留言,值班小编第一时间回复。 下一篇内容是有关《华为荣耀7小米5和iphoneSE买谁合适?如何看待oppo R11独占骁龙660三个月》,感兴趣的同学可以点击进去看看。

资源转载网络,如有侵权联系删除。

相关资讯推荐

相关应用推荐

玩家点评

条评论

热门下载

  • 手机网游
  • 手机软件

热点资讯

  • 最新话题