清规 提问:#include <iostream>
using namespace std;
int main() {
char a[] = "I";
char b[] = "love";
char c[] = "you";
// Pointer array
char* p[3];
p[0] = a;
p[1] = b;
p[2] = c;
// Print each string
for (int i = 0; i < 3; ++i) {
cout << p[i] << " "; // Print strings with a space in between
cout << endl;
}
return 0;
}
在这里的代码当中,为什么输出结果是“i love you”而不是三个数组的首地址呢?
对于字符串而言,cout 的时候传入字符串名字...