Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可以说我在下面有这个。
int arrays = 0; cin >> arrays ; for(int i = 0; i < arrays ; i++) { ????? Not sure what to do here. }
我想用 39 个元素(40)创建用户输入的 x 个数组。我将如何创建它forloop来创建 4 个数组?例如它会使array1 array2 array3 array4
forloop
array1
array2
array3
array4
int arrays = 0; cin >> arrays ; int *ptr = new int [arrays]; //Make sure to validate arrays against errors //and don't forget to de-allocate using delete[] when done for(int i = 0; i < arrays ; i++) { ptr[i] = i; }