int main() { typedef std::string AddressLines[4]; std::string *pal = new std::string[4]; std::string *pal1 = new AddressLines; delete [] pal; delete [] pal1; return 0; }
typedef std::string AddressLines[4]; 這樣定義居然是代表AddressLines是一個string數組,4個string。
new std::string[4] 和 new AddressLines 是同一個意思,刪除時必須用delete[]