Error with irr::core::array when it's in the heap.
Posted: Thu Nov 02, 2006 8:31 pm
Hello all,
I need to create an array in the heap and i use this code
With this code I get the error:
error C2440: 'initializing' : cannot convert from 'irr::core::array<T> *' to 'irr::core::rect<T> '
However the same thing but in the stack works fine:
I thought it would work with the array in the heap, but it's not, maybe I'm not allocating the array correctly but I can't figure out whats going on.
Edit: well, I see it's trying to convert the array instead of the element in the array, but I don't know why
I need to create an array in the heap and i use this code
Code: Select all
irr::core::array<rect<s32>> *IrrArray = new irr::core::array<rect<s32>>();
rect<s32> r= &IrrArray[0];
error C2440: 'initializing' : cannot convert from 'irr::core::array<T> *' to 'irr::core::rect<T> '
However the same thing but in the stack works fine:
Code: Select all
array<rect<s32>> IrrArray;
rect<s32> r = IrrArray[0];
Edit: well, I see it's trying to convert the array instead of the element in the array, but I don't know why