class Simple {
string *data ;
//some functions and declaration of some variable,const, dest
};
私がしたとき、なぜsizeof Variablename/sizeof * VariableNameは必要に応じて機能しませんか?
data = new string [10] ;
cout << sizeof data/sizeof *data << endl ;
==> 1 // output
data = new string [50];
cout <<sizeof data/sizeof *data <<endl ;
==> 1 // output
**Why** do all output display the same ?
[C - > sizeof stringは常に8 ...]の可能な複製(http://stackoverflow.com/questions/4941142/c-sizeof-string-is-always-8) –