[Solved] How to find all elements in vector that are greater than certain number? [duplicate]
[ad_1] You would use a loop and access the amount member: #include <iostream> #include <vector> #include <string> struct Record { int amount; std::string name; }; static const Record database[] = { { 5, “Padme”}, {100, “Luke”}, { 15, “Han”}, { 50, “Anakin”}, }; const size_t database_size = sizeof(database) / sizeof(database[0]); int main() { std::vector<Record> vector1; … Read more