I'm learning Cpp recently, and today when I use Clion to learn do some testing strange thing happened.
(我最近在学习Cpp,今天,当我使用Clion学习做一些测试时,奇怪的事情发生了。)
Here is my code
(这是我的代码)
int main() {
char c = 'b';
char carr[1]{'a'};
char *p1 =&(carr[0]);
char *p2 =&c;
return 0;
}
Complier:
(编译器:)
4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.8)
(4.2.1兼容的Apple LLVM 11.0.0(clang-1100.0.33.8))
lldb :
(lldb:)
And here is the details of memory:
(这是内存的详细信息:)
Please help me to figure out the reasons!
(请帮我找出原因!)
ask by tzyrq translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…