Ошибка:
In function ‘int returnShortestWeightedBranch(std::vector<route, std::allocator<route> >*)’:
error: name lookup of ‘jj’ changed for ISO ‘for’ scoping
note: (if you use ‘-fpermissive’ G++ will accept your code)
Код:
for (int i = 0; i< routeVector.size(); i++)
{
if (routeVector[i].exitPoint == exitPointDetailsVector[preserveL].exitPoint)
{
cout << "\n-----------parent: " << routeVector[i].exitPoint;
branch obj;
obj.connectedExitPoint = exitPointDetailsVector[preserveI].exitPoint;
routeVector[i].selectedBranchesVector.push_back (obj);
for (int jj = 0; jj < routeVector[i].selectedBranchesVector.size(); jj++);
{
cout << "\n-----------branch: " << routeVector[i].selectedBranchesVector[jj].connectedExitPoint;
}
}
}
В чем здесь проблема?
РЕДАКТ. 1:
Я изменил следующее:
for (int jj = 0; jj < routeVector[i].selectedBranchesVector.size(); jj++);
на:
int jj;
for (jj = 0; jj < routeVector[i].selectedBranchesVector.size(); jj++);
и теперь работает !!Я не понимаю ПРИЧИН.