#include <stdio.h>spa
~ .net
[ymy@ymy tem]$ ./a.out s1-0x8048504,s2-0x8048504,str1-0xbfb3c803,str2-0xbfb3c7fe 简单说明:字符串常量存放在只读数据段,相同的字符串保存在同一个位置,因此s1==s2;字符串
可是str1和str2是局部变量,保存在堆栈上,是各自独立的,虽然内容同样,可是str1!=str2;get