I have a map with a structure as a value type
map<int id, struct_t*> table struct_t { int prev; int wt; string name; }
Using only prev, I need to find the corresponding id. Thanks for that in advance!
EDIT:
int key=0; for(auto it = table.begin(); it != table.end(); ++it) { if(table[(*it).first].prev == ?) }
Here's what my map data looks like:
id prev abundance thing 1573 -1 0 book 1864 1573 39 beds 2075 1864 41 tray 1760 2075 46 cups
For each identifier, I need to find the NEXT-matching identifier. So, for 1573 from the previous column, I need to find the corresponding "id", which is 1864. In addition, std :: next does not work, because the data set may not have the corresponding identifiers in the next element. Hope this helps
PLEASE PLEASE help me !!! My boss is already disappointed that I have so much time to learn C ++ (it has been 3 weeks already!)
source share