For statement shows undefined identifier "vec"

the code as follows:

	auto frameCache = SpriteFrameCache::getInstance();
	frameCache->addSpriteFramesWithFile("protagonist_move/aaaa.plist");
	auto sprite = Sprite::createWithSpriteFrameName("protagonist_move/10020.png");
	sprite->setPosition(Vec2(600 , 700));
	this->addChild(sprite); 	
	Vector<SpriteFrame*> vec;
	char name[2] = {};
	for (int i =10020 ; i <=10021 ; i++) {
		sprintf(name, "%d.png", i);
		vec.pushBack(frameCache->getSpriteFrameByName(name));
	}
	auto animation = Animation::createWithSpriteFrames(vec, 0.2f, 1000);
	animation->setDelayPerUnit(0.05f);
	animation->setLoops(-);
	animation->setRestoreOriginalFrame(true);
	auto animate = Animate::create(animation);
	sprite->runAction(animate);

The following line shows unrecognized mark:

this->addChild(sprite);

for statement shows undefined identifier “vec”:

	for (int i =10020 ; i <=10021 ; i++) {
		sprintf(name, "%d.png", i);
		vec.pushBack(frameCache->getSpriteFrameByName(name));
	}

Try
std::vector<SpriteFrame*> vec;

Plz Check also your return values.
Maybe your Sprite pointer is NULL.
I belive you be a beginner, plz read c++ tutorials also.
Thats ist your third entry with the most same issues.