首页 > 其他 > 详细

C knowledge

时间:2019-11-08 11:23:35      阅读:68      评论:0      收藏:0      [点我收藏+]

1. pointer & const

技术分享图片

 

Key point: The * is the seperator. The right side is declarator,  *p is a pointer, *const p is a const pointer. The left side is the specifiers, is type. const T and T const are same. 

(1) = (2), p pointer point to const T, p can be changed. T cannot be changed.

(4) = (5), const p pointer point to const T, p and T cannot be changed.

(3), const p pointer point to T, T can be changed. p cannot be changed.

The storage specifiers like static or exter are for p. example, static const T *p. 

 

C knowledge

原文:https://www.cnblogs.com/zjbfvfv/p/11818887.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!