How to use array in cocos2d-x v3.2

How we use ccArray for initialising and access the value of it ?
Please help.

I am also having the same problem in creating ccArray in cocos2d-x v3.Please suggest if any…

What’s the problem?
And may be you can try to use cocos2d::Vector or std::vector.

Here’s a good post, it will help you understand arrays (std::vector)

std::vector - cplusplus.com

It’s the way to go :smile:

Thanks @zhangxm and @StainzE
But I need to add different data type object in a array. How can we do it ?

Hi
You can use std::vector
Hope this help

This explains std::vector better, compares it to a normal array:
http://www.codeguru.com/cpp/cpp/cpp_mfc/stl/article.php/c4027/C-Tutorial-A-Beginners-Guide-to-stdvector-Part-1.htm

You can have your own data object, say a class or a struct and use it with the vector, e.g:

Class myData
{
float f1;
int iVals[100];
};

myData m1;
myData m2;
std::vector myVArray;
myVArray.push_back(m1);
myVArray.push_back(m2);