pointer / array question
I need to make a dynamically-allocated two-dimensional array.
so what i did was:
then i get my width and my height.
arrayPtr = new int[width][height];
i keep getting this error saying:
error C2440: '=' : cannot convert from 'int (*)' to 'int ** '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
am I not doing this properly for a two demensional array?
>am I not doing this properly for a two demensional array?
matrix = new int*[rows];
for ( int i = 0; i < rows; i++ )
matrix[i] = new int[cols];
ooh, alright I understand now
works perfectly, thanks :D