Q: 17
What happens when you attempt to compile and run the following code?
#include
#include
#include
using namespace std;
template void print(T start, T end) {
while (start != end) {
std::cout << *start << " "; start++;
}
}
int main(){
vectorv;
multiset s;
for(int i=10; i>0; i??) {
v.push_back(i); s.push_back(i);
}
print(v.begin(), v.end()); print(s.begin(), s.end());cout<<endl;
return 0;
}
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.