#include
<
iostream
>
#include < string >
using namespace std;
int main( int argc, char * argv[])
... {
cout << "sizeof(string) = " << sizeof(string) << endl;
string str[] = ...{"sdf4", "123", "d"};
string str4[4] = ...{"str33", "mmmmm"};
cout << "sizeof(str) = " << sizeof(str) << endl;
cout << "sizeof(str4) = " << sizeof(str4) << endl;
string *pStr = new string[2];
pStr[0] = "us";
pStr[1] = "cn";
cout << endl;
cout << "sizeof(pStr) = " << sizeof(pStr) << endl;
cout << "sizeof(*pStr) = " << sizeof(*pStr) << endl;
cout << endl;
char b[] = "fcdg123";
cout << "b = " << b << endl;
cout << "sizeof(b) = " << sizeof(b) << endl;
cout << "*b = "<< *b << endl;
cout << "sizeof(*b) =" << sizeof(*b) << endl;
cout << endl;
char *c = "fcdg123";
cout << "c = " << c << endl;
cout << "sizeof(c) = " << sizeof(c) << endl;
cout << "*c = "<< *c << endl;
cout << "sizeof(*c) =" << sizeof(*c) << endl;
return;
}
#include < string >
using namespace std;
int main( int argc, char * argv[])
... {
cout << "sizeof(string) = " << sizeof(string) << endl;
string str[] = ...{"sdf4", "123", "d"};
string str4[4] = ...{"str33", "mmmmm"};
cout << "sizeof(str) = " << sizeof(str) << endl;
cout << "sizeof(str4) = " << sizeof(str4) << endl;
string *pStr = new string[2];
pStr[0] = "us";
pStr[1] = "cn";
cout << endl;
cout << "sizeof(pStr) = " << sizeof(pStr) << endl;
cout << "sizeof(*pStr) = " << sizeof(*pStr) << endl;
cout << endl;
char b[] = "fcdg123";
cout << "b = " << b << endl;
cout << "sizeof(b) = " << sizeof(b) << endl;
cout << "*b = "<< *b << endl;
cout << "sizeof(*b) =" << sizeof(*b) << endl;
cout << endl;
char *c = "fcdg123";
cout << "c = " << c << endl;
cout << "sizeof(c) = " << sizeof(c) << endl;
cout << "*c = "<< *c << endl;
cout << "sizeof(*c) =" << sizeof(*c) << endl;
return;
}
sizeof
(
string
)
=
16
sizeof (str) = 48
sizeof (str4) = 64
sizeof (pStr) = 4
sizeof ( * pStr) = 16
b = fcdg123
sizeof (b) = 8
* b = f
sizeof ( * b) = 1
c = fcdg123
sizeof (c) = 4
* c = f
sizeof ( * c) = 1
sizeof (str) = 48
sizeof (str4) = 64
sizeof (pStr) = 4
sizeof ( * pStr) = 16
b = fcdg123
sizeof (b) = 8
* b = f
sizeof ( * b) = 1
c = fcdg123
sizeof (c) = 4
* c = f
sizeof ( * c) = 1