1. char * str1="hello";
char * str2="hello";
*str1='p';
cout<<str2<<str1<<endl;
问执行结果?
这是在论坛上看到的一个例子,很有趣。
如果将程序改为如下,就什么问题都没有了
1. char * str1="hello";
char * str2="hello_kitty";
*str1='p';
cout<<str2<<str1<<endl;
问执行结果?
转载请注明原文地址: https://ibbs.8miu.com/read-16203.html