A
Alatarie
Hi all,
This is probably a stupid question but I've been out of the c++ thing for a
while...
I'm trying to make a vector of structs. Each time I create a struct:
struct RECORDS
{
int id;
other vars
....
};
I use an iterator to go through the vector to see if a struct with a
matching id exists, as this affects the other struct variables. However,
comparing the current id with *iterator.id does not work. This is what I
have:
for(it = records.begin(); it != records.end(); it++)
{
partID = *it.partID;
if(record.partID == *it.partID)
{
found = true;
}
}
Does anyone have any suggestions?
Thanks
This is probably a stupid question but I've been out of the c++ thing for a
while...
I'm trying to make a vector of structs. Each time I create a struct:
struct RECORDS
{
int id;
other vars
....
};
I use an iterator to go through the vector to see if a struct with a
matching id exists, as this affects the other struct variables. However,
comparing the current id with *iterator.id does not work. This is what I
have:
for(it = records.begin(); it != records.end(); it++)
{
partID = *it.partID;
if(record.partID == *it.partID)
{
found = true;
}
}
Does anyone have any suggestions?
Thanks