Answer the question
In order to leave comments, you need to log in
Is it possible to add rows to a 2D dynamic array after it has been declared?
C++, declared din. 2-dimensional array with coordinates of points and values. functions in them (x, y, f). If a new dot appears - can I add another line?
Answer the question
In order to leave comments, you need to log in
No, you can’t, you need to re-allocate the array of the required size, copy it from the old one, delete the old one, add the necessary records.
Or use stl containers.
ArrIn = new float*[pointsIn]; //строк в массиве
for (int i=0; i<pointsIn; i++) ArrIn[i] = new float[3]; //три столбца
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question