源代码:
#include<iostream>
using namespace std;
int main()
{
char a[] = "string";
char b[] = "string";
bool test = a==b;
cout<<"a[]?b[]:"<< boolalpha<<test<<endl;
char *c = "string";
char *d = "string";
test = (c==d);
cout<<"*c?*d:"<<boolalpha<<test<<endl;
char e[10] = "string";
char f[10] = "string";
test = (e==f);
cout<<"e[10]?d[10]:"<<boolalpha<<test<<endl;
return 0;
}
运行结果: