Get answers to all your basic programming questions. No Ogre questions, please!
- Orc Shaman
- Posts: 777
- Joined: Mon Jan 18, 2010 6:06 pm
- Location: Costa Mesa, California
Hi guys, I'm trying to initialize a vector like this -
Code: Select all
But I'm just getting a crash in the <vector> cpp file so I'm guessing there's something wrong here. Any thoughts on this one?
- Posts: 6
- Joined: Tue Jul 15, 2014 12:17 am
If you use a pointer, you must allocate memory for it.
std::vector<std::vector<hkReal>> *terrainVertices = new std::vector<std::vector<hkReal>>();
- OGRE Team Member
- Posts: 4034
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 214
And don't forget to delete the memory afterwards.