visual studio 2012 - cocos2dx c++ looping through cocos2d::Vector -
hi kind of new c++ , cocos2dx. trying following:
//mainscene.cpp vector<string> frames; frames.pushback("ground"); frames.pushback("sky_bg"); each (string sprite_name in frames) { }
this gives following error in vs2012
a 'for each' statement cannot operate on expression of type "cocos2d::vector
so how should going this?
correct way use :
for (const string& sprite_name : frames) { // code }
Comments
Post a Comment