Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
2d dynamic memory allocation
Atomz last edited by
Hello I am new to Qt C++.
I am trying to allocate a memory for 2d array like int** array; but its crashing.
Hi and welcome to devnet,
How are you doing the allocation ?
Did you run your application through the debugger ?
Kent-Dorfman last edited by Kent-Dorfman
do you know that size of the array in advance?
can you create and access it using subscripts? or what is the reason for creation by pointer...since when talking about arrays the generally accepted access method is by subscript, and only by pointer as a possible optimization later.
20 rows of 10 columns worth of strings now exist.
or int myInts = new int[row*col];
auto v = myInts[(col * y) + x];