#include
<iostream>
using
namespace
std;
int
main()
{
char
str1[] =
"abc"
;
char
str2[] =
"abc"
;
const
char
str3[] =
"abc"
;
const
char
str4[] =
"abc"
;
char
* str5 =
"abc"
;
char
* str6 =
"abc"
;
const
char
* str7 =
"abc"
;
const
char
* str8 =
"abc"
;
cout << (str1 == str2) << endl;
cout << (str3 == str4) << endl;
cout << (str5 == str6) << endl;
cout << (str7 == str8) << endl;
system(
"pause"
);
return
(0);
}
输出为
0
0
1
1
因为数组的地址不同,指针的地址相同