F
free2cric
Hi ,
I am using stl map
struct elmStructure
{
int type;
int num;
};
map <string, tempStructure> c_elmmap;
char mapStr[200];
in my code, I define mapStr, tempStructure tStr
and populate my map as
tStr.type = 7; tStr.num = 1700;
sprintf(mapStr,"%d%d", tStr.type, tStr.num);
c_elmmap[mapStr] = tStr;
and so onn....
I want to visit all the mapped structures
map <string, elmStructure> :: iterator MyIterator ;
MyIterator = c_elmmap.begin();
while(MyIterator != c_elmmap.end())
{
//elmStructure& temp =
MyIterator++;
}
so please tell me elmStructure& temp = ?????????? in above block
Thanks Am I going correctly in defining map as shown above.
Thanks,
cric
I am using stl map
struct elmStructure
{
int type;
int num;
};
map <string, tempStructure> c_elmmap;
char mapStr[200];
in my code, I define mapStr, tempStructure tStr
and populate my map as
tStr.type = 7; tStr.num = 1700;
sprintf(mapStr,"%d%d", tStr.type, tStr.num);
c_elmmap[mapStr] = tStr;
and so onn....
I want to visit all the mapped structures
map <string, elmStructure> :: iterator MyIterator ;
MyIterator = c_elmmap.begin();
while(MyIterator != c_elmmap.end())
{
//elmStructure& temp =
MyIterator++;
}
so please tell me elmStructure& temp = ?????????? in above block
Thanks Am I going correctly in defining map as shown above.
Thanks,
cric