📜  在 C++ 代码示例中初始化一个数组

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

代码示例2
int* a = NULL;   // Pointer to int, initialize to nothing.
int n;           // Size needed for array
cin >> n;        // Read in the size
a = new int[n];  // Allocate n ints and save ptr in a.
for (int i=0; i