What will happen when you attempt to compile and run the following code? Choose all possible answers.
#include
using namespace std;
class B {};
template
class A {
T_v;
public:
A() {}
A(T v): _v(v){}
T getV() { return _v; }
void add(T a) { _v+=a; }
};
int main()
{
A
Ab;
a.add(10);
cout << a.getV() < return 0; }
What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: 64 100
#include
#include
#include
#include
using namespace std;
int main ()
{
string s;
getline(cin, s);
stringstream input(s);
stringstream output;
for( ; !input.fail() ; )
{
int i;
input>>hex>>i;
output< } cout< return 0; } What will be the result assuming that user will enter following sequence: 64 100:
What happens when you attempt to compile and run the following code?
#include
#include
#include
using namespace std;
class B { int val;
public:
B(int v):val(v){}
int getV() const {return val;} bool operator < (const B & v) const { return val ostream & operator <<(ostream & out, const B & v) { out< template ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) { out< int main() { int t[]={8, 10, 5, 1, 4, 6, 2, 7, 9, 3}; vector v1(t, t+10); sort(v1.begin(), v1.end(), greater()); for_each(v1.begin(), v1.end(), Out(cout));cout< return 0; } Program outputs:
What happens when you attempt to compile and run the following code?
#include
#include
#include
#include
#include
using namespace std;
int main()
{
int t[] ={ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
deque
queue
queue
queue
queue
mylist.clear();third.clear();
cout< cout< return 0; }
What happens when you attempt to compile and run the following code?
#include
#include
#include
using namespace std;
int main ()
{
int t[] = {1, 2 ,3 ,4 ,5};
vector
list
l1.assign(v1.end(), v1.begin());
for(int i=0; i { cout< } cout< return 0; }
Nicolas Sidorov
24 hours agoSharon Hall
26 days agoMatthew Morris
2 months agoKaren Hernandez
2 months agoEmma Reed
2 months agoJoseph Harris
1 month agoNancy Bailey
2 months agoWilliam Gonzalez
2 months agoAndrew Nguyen
2 months agoLoise
3 months agoKyoko
3 months agoDevora
3 months agoCarlota
3 months agoFletcher
4 months agoMajor
4 months agoGwen
4 months agoKris
4 months agoDonte
5 months agoKimberlie
5 months agoMarquetta
5 months agoGlory
5 months agoFatima
6 months agoOmega
6 months agoKristin
6 months agoPaz
6 months agoRose
7 months agoMarge
7 months agoGail
7 months agoDaren
7 months agoTarra
8 months agoFannie
8 months agoPearlie
8 months agoDonte
8 months agoSilva
9 months agoGiuseppe
9 months agoAileen
9 months agoSabra
10 months agoAnnmarie
10 months agoBuffy
1 year agoDyan
1 year agoSalena
1 year agoSalley
1 year agoArlean
1 year agoCaren
1 year agoAleisha
2 years agoLanie
2 years agoJohnetta
2 years agoChristiane
2 years agoStanford
2 years agoYuette
2 years agoDallas
2 years agoIndia
2 years agoAleisha
2 years agoRoselle
2 years agoVincenza
2 years agoLyda
2 years agoNoah
2 years agoMammie
2 years agoThea
2 years agoArlean
2 years agoMargarita
2 years ago