c++通用解释q

c++ general interpretation q

本文关键字:解释 c++      更新时间:2023-10-16

这是家庭作业,所以我不想让你给我答案,我只想知道我的老师到底想让我做什么?

给定字符串指针和下面的变量sz,使用它们来动态创建一个大小为sz的数组

string * sp;
int sz=5;

他希望您编写一行代码,动态地将指针数组分配给大小为sz的字符串。

string * sp;
int sz = 5;
// put a line of code here that allocates the array