#include <iostream> #include <set> #include <iterator> using namespace std; struct keker{ int a; int b; }; int main(int argc, char const *argv[]) { set<keker> rofl; keker k1,k2,k3,k4; k1.a = 1; k2.a = 2; k3.a = 3; k4.a = 4; rofl.insert(k1); rofl.insert(k2); rofl.insert(k3); rofl.insert(k4); cout<< rofl.begin()->a<<endl; cout<< rofl.end()->a<<endl; return 0; } After compilation displays: 1 1
Although it should output: 1 4
Please help me all day with it