由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - [合集] 一个指针的小问题
相关主题
数组指针的问题[合集] 简单问题一个:为什么可以间接访问私有指针成员
请教一个关于字符指针的简单问题怎么得到char *分配空间的大小?
typedef const char *month Table[3]const char *p, is it ok to change p[1] ?
谁给解释一下这个c question请教boost::any compile错误。
c++ template specialization 参数[合集] static const代替define的performance tradeoff在哪里?
关于C++中const的问题[合集] const 变量问题
why int** cannot convert to const int** ?谁来解释一下这个是compiler问题吗?
数组问题关于Makefile的一个问题
相关话题的讨论汇总
话题: const话题: char话题: str3话题: str4话题: abc
进入Programming版参与讨论
1 (共1页)
c***d
发帖数: 996
1
☆─────────────────────────────────────☆
hapyrockets (hapyrockets) 于 (Thu Sep 27 19:16:35 2007) 提到:
下面的语句:
const char str3[] = "abc";
const char str4[] = "abc";
const char* str5 = "abc";
const char* str6 = "abc";
为什么
str3 == str4 -> false
str5 == str6 -> true
都是const, 我觉得 compiler让str3, str4, str5, str6都指向一个地址也未尝不可啊

☆─────────────────────────────────────☆
Pontiff (树) 于 (Thu Sep 27 19:26:08 2007) 提到:
再说一遍,数组不是指针

下面的语句:
const char str3[] = "abc";
const char str4[] = "abc";
const char*
1 (共1页)
进入Programming版参与讨论
相关主题
关于Makefile的一个问题c++ template specialization 参数
c++标准函数传递一问关于C++中const的问题
C++ 的 问题why int** cannot convert to const int** ?
问个php的问题数组问题
数组指针的问题[合集] 简单问题一个:为什么可以间接访问私有指针成员
请教一个关于字符指针的简单问题怎么得到char *分配空间的大小?
typedef const char *month Table[3]const char *p, is it ok to change p[1] ?
谁给解释一下这个c question请教boost::any compile错误。
相关话题的讨论汇总
话题: const话题: char话题: str3话题: str4话题: abc