Question
(12 points) Single choice question (4 points) Suppose p is an output operator that can access an integer item, which operation in the following wont
(12 points) Single choice question
(4 points) Suppose p is an output operator that can access an integer item, which operation in the following wont report an error?
a) cout<< *p << endl;
b) int i = *p;
c) double i = *p;
d) *p = 2;
(4 points) Suppose we have a multiset object s, with 4 elements already exist: 1, 3, 8, 11. If we use insert function to insert a new item 6, then which position 6 will be inserted (select a, b, c, d, or e):
___, 1, ___ 3, ___, 8 ___, 11, ___,
("a" being the first blank space and so on) a b c d e
(4 points) Suppose p is a random access iterator that provides the access to the second element 2 in an array {1, 2, 3, 4, 5, 6}, then which element that p[2] provides the access to?
a) 3
b) 4
c) 5
d) 6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started