#include <iostream>
#include <string>
using namespace std;
void main()
{
//exp.1
string str[] = {"a","bc","def"};
string *strPtr = str;
cout << "str[] is {\"a\", \"bc\", \"def\"}" << endl;
cout << "str is : "<< str << endl;
cout << "*str is : " << *str << endl;
cout << "str[0] is: " << str[0] << endl;
cout << "&str is: " << &str << endl;
cout << "*(int*)(str) is " << *(int*)(str) << endl;
cout << "sizeof str is: " << sizeof(str) << endl;
cout << "sizeof string is :" << sizeof(string) << endl << endl;
cout << "*strPtr = str" << endl;
cout << "sizeof *strPtr is : " << sizeof(*strPtr) << endl;
cout << "sizeof strPtr is : " << sizeof(strPtr) << endl;
cout << "*strPtr is : " << *strPtr << endl;
cout << "strPtr is : " << strPtr << endl;
cout << "&strPtr is : " << &strPtr << endl;
/*
str[] is {"a", "bc", "def"}
str is : 0012FEF4
*str is : a
str[0] is: a
&str is: 0012FEF4
*(int*)(str) is 0
sizeof str is: 96
sizeof string is :32
*strPtr = str
sizeof *strPtr is : 32
sizeof strPtr is : 4
*strPtr is : a
strPtr is : 0012FEF4
&strPtr is : 0012FEE8
请按任意键继续. . .
*/
}