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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!