#include <bits/stdc++.h>
using namespace std;
int main()
{
sets;
pair<set::iterator, bool> ret;
s.insert(1);
s.insert(5);
s.insert(10);
s.insert(3);
ret = s.insert(10);
cout<<ret.second<<endl;
return 0;
}
I can't able to understand why I am getting 0 as output
can u explain what exactly u are trying to do… the code is not running only and giving errors
1 Like
What will be the output of following C++ code?
#include <bits/stdc++.h>
using namespace std;
int main()
{
set<int>s;
pair<set<int>::iterator, bool> ret;
s.insert(1);
s.insert(5);
s.insert(10);
s.insert(3);
ret = s.insert(10);
cout<<ret.second<<endl;
return 0;
}
i am asking what are u trying to do… pls explain ur code
Actually this is question in my course name STL Quiz-1. I have bought cp course.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.