为数组分配 space

Allocating space for an array

我有一个动态分配整数数组的 C++ 程序。在下面的最终函数中,我不知道如何为数组分配 space,new int[*arrPtr]; 是我在阅读指针章节后想到的,它编译正确,但程序崩溃.谁能看看我的代码并指出正确的方向?

非常感谢您就此事提供的帮助,非常感谢您抽出宝贵时间。

不是

new int[*arrPtr]

arrPtr = new int[num]; //num is the size of the array.