#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