2009年5月2日

常指针与指针常量的区别(转帖)

摘要: 三个名词虽然非常绕嘴,不过说的非常准确。用中国话的语义分析就可以很方便地把三个概念区分开。 一) 常量指针。 常量是形容词,指针是名词,以指针为中心的一个偏正结构短语。这样看,常量指针本质是指针,常量修饰它,表示这个指针乃是一个指向常量的指针(变量)。 指针指向的对象是常量,那么这个对象不能被更改。 在C/C++中,常量指针是这样声明的: 1)const int *p; 2)int cons... 阅读全文

posted @ 2009-05-02 23:39 ATAK 阅读(3082) 评论(2) 推荐(0) 编辑

个人觉得c++primer中最爽的一段话

摘要: A variable provides us with named storage that our programs can manipulate. Each variable in C++ has a specific type, which determines the size and layout of the variable's memory; the range of valu... 阅读全文

posted @ 2009-05-02 22:59 ATAK 阅读(310) 评论(0) 推荐(0) 编辑

导航