What happens when you attempt to compile and run the following code?#include <deque>#include <vector>#include <iostream>#include <string>using namespace std;template<typename T>void print(T start, T end){while (start != end)cout<<*start++;}int main (){string t[] = {"one", "two" ,"three" ,"four", "five"};vector<string>v1(t, t+5);deque<string>d1(v1.rbegin(), v1.rend());d1.push_back("zero");print(d1[0].rbegin(),d1[0].rend());return 0;}
A. program outputs: orez
B. program outputs: evif
C. compilation error
D. program outputs: five
What happens when you attempt to compile and run the following code?#include <deque>#include <vector>#include <iostream>
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What happens when you attempt to compile and run the following code?#include <deque>#include <vector>#include <iostream>
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!