M
Mike Copeland
I have the following definition and declaration:
typedef struct ChipRecord // Chip Times record
{
int bibNum; // Bib #
short entAge; // Age
char entGender; // Gender (M/F)
char entRCode; // RCode
char entECode; // Entrant Type code
string entName; // Entrant Name
} tData; // entrant info records
tData tWork;
typedef map<int, ChipRecord> BCI;
BCI bci;
map<int, ChipRecord>::iterator bIter;
I'm reading a data file and storing objects of this type:
tWork.entName = "Doe, John";
tWork.entGender = 'M';
tWork.entAge = 89;
bci.insert(BCI::value_type(47, tWork));
[etc.]
However, in subsequent processing I have to _change_ some of
this data (e.g. modify the entAge value). For example:
bIter = bci.find(47);
if(bIter != bci.end()) // DBE record exists in base file
{
tData &qWork = bIter->second;
qWork.entAge = 35;
// What do I do here to update the map object I've accessed?
}
typedef struct ChipRecord // Chip Times record
{
int bibNum; // Bib #
short entAge; // Age
char entGender; // Gender (M/F)
char entRCode; // RCode
char entECode; // Entrant Type code
string entName; // Entrant Name
} tData; // entrant info records
tData tWork;
typedef map<int, ChipRecord> BCI;
BCI bci;
map<int, ChipRecord>::iterator bIter;
I'm reading a data file and storing objects of this type:
tWork.entName = "Doe, John";
tWork.entGender = 'M';
tWork.entAge = 89;
bci.insert(BCI::value_type(47, tWork));
[etc.]
However, in subsequent processing I have to _change_ some of
this data (e.g. modify the entAge value). For example:
bIter = bci.find(47);
if(bIter != bci.end()) // DBE record exists in base file
{
tData &qWork = bIter->second;
qWork.entAge = 35;
// What do I do here to update the map object I've accessed?
}