📜  动态分配一个字符串对象,并将地址保存在指针变量p中. - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:53.994000             🧑  作者: Mango

代码示例1
#include 

int main()
{
string* p;
int n;

p = new string; // Dynamically allocate a string object and save the address in the pointer variable p.

}