Answer the question
In order to leave comments, you need to log in
How to fix problem in 2D dynamic array?
There is a dynamic array. And, apparently, there are some problems during initialization, the debugger suggested that the program is accessing memory that does not belong to it.
When the program is executed, the following thing happens: let's say size = 3, then when reading the array elements, only three pieces are read instead of nine.
Here's the code : pastebin.com/WgAFnM4Z
The conditions don't allow using vector, and I don't want to use a constant array size, so as not to get confused with pointers in functions. What am I doing wrong?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question