How to filter data in vector of structure
Hi I have a structure which has 7 integers and 2 strings as data fields. I have few objects of this structure stored into vector. How to sort the data? Sorting should be done on 1 value of integer and need to discard other elements. For example, A,B,C,D,E,F,G are headers of data and 1,2,3,4,5,5-1 1,2,3,4,6,5,2 1,2,3,6,4,5,3 If G is my sorting header and filter criteria is A,B,C then output should have only one row 1,2,3,6,4,5,3 Why ? Because A,B,C is same for all three rows and out of these rows, row having 3 is max If G is my sorting header and criteria is A,B,C,D then output should have two rows 1,2,3,4,6,5,2 (max from first two rows as both these have same A,B,C,D) 1,2,3,6,4,5,3 (as this is unique and not same values of A,B,C,D with previous rows) Any suggestion will be helpful.