Page 1 of 1

What happens when you attempt to compile and run the following code?#include <deque>#include <iostream>#include <algorit

Posted: Wed Aug 03, 2022 9:20 am
by answerhappygod
What happens when you attempt to compile and run the following code?#include <deque>#include <iostream>#include <algorithm>#include <set>using namespace std;template<class T>struct Out {ostream & out;Out(ostream & o): out(o){}void operator() (const T & val ) { out<<val<<" "; }};bool Compare(char a, char b) { return tolower(a) < tolower(b);} int main() { char s[]={"qwerty"}; char t1[]={"ert"}; char t2[]={"ERT"}; sort(s, s+6); cout<<includes(s,s+6, t1,t1+3, Compare)<<" "<<includes(s,s+6, t2,t2+3, Compare)<<endl; return 0;}Program outputs:

A. 0 0
B. 0 1
C. 1 0
D. 1 1