new创建对象的如何传递构造参数-c++

来源:互联网 发布:淘宝客引流方法 编辑:程序博客网 时间:2024/05/20 23:36

new 是C++的,会调用构造函数,可以使用如下方法传递参数给构造函数

int *a = new int[3]{ (1),(2),(3) };



1 0