enumerated type and lvalue missing
I've writen some program in borland C++ builder X the want to compile it in builder 6 and VS C++ 2005 and i've got such problem in both compilers i get such error
"error C2676: binary '++' : 'TerrainType' does not define this operator or a conversion to a type acceptable to the predefined operator" in VS
and
"[C++ Error] Modedit.cpp(33): E2277 Lvalue required" in C++ Builder 6
for this part of code
Code:
for (TerrainType terrain=Plains;terrain<=Village;terrain++)
where TerrainType is enumerated type
Code:
enum TerrainType
{
Plains=0,
Forest,
Hills,
Swamp,
Water,
Village
};
so how to make this loop work properly i've tried "+1" instead of "++" but then VS still shows errors and Builder compiles but program starts an infinit loop.