When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
38 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
some documentation for multimap https://en.cppreference.com/w/cpp/container/multimap
Maybe you'll be able to find what you're looking for here. Try reading the descriptions of what all the available functions do
i have already read the whole documentation
can you give me any hint?
because i have spent a lot time and still havn't got the idea
the problem is how i supposed to search with struct field?
int count = cpis...........(checkCpi)
in this line
im searching whole struct in multimap
but key is of type double
well I think youre likely looking for multiset instead then since youre searching for whole Students not just a specific part
although honestly this question isnt great
But yeah multiset and then count and find
true
its unclear how a specific comparison works between Students though
Do students compare equal ignoring the name?
yesss
i suppose
that's why there is a empty struct with cpi only?
i guess
If they do then multiset is probably the way. Although with those you can actually specify an equality operator for multiset as part of the template parameters
I doubt they want that though since it doesnt fit the answer structure
i can pass euality operator in multiset parameter tho
is this correct?
but how i suppose to use count with checkCpi
nvm this question is bad
thank you for your response!
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity
you want a set if youre doing set operations not a map
youre not mapping the cpi
well you are
but the way they are doing it is via a set

its not that confusing. You just replace multimap<double Student, ...> with multiset<Student, ...>
and suddenly all the operations make sense