Two dimesional vector array
Im trying to design q normal calculation system. I tried to create a two dimensional array of CVector3's on heap. But it keeps saying:
34 C:\Documents and Settings\Kris2456\My Documents\Programming\Engine\Terrain.cpp
cannot convert `CVector3 (*)[2]' to `CVector3*' in
I tried to declare it as this:
CVector3 *PolyMap = new CVector3[1023*1023][2];
Could anyone help, i assume it will be an easy answer. Thx
CVector3 (*PolyMap)[2] = new CVector3[1023*1023][2];
delete [] PolyMap;
Also consider boost::multi_array and std::vector.
delete [] PolyMap;
Also consider boost::multi_array and std::vector.
Another solution is via dynamic allocation.
typedef std::vector<int> vecInt;
vecInt **x = new vecInt *[1];
x[0] = new vecInt;
Kuphryn
typedef std::vector<int> vecInt;
vecInt **x = new vecInt *[1];
x[0] = new vecInt;
Kuphryn
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement