Question: 1. Back to pointer daco, it still points at a dynamically allocated Banana. What is equivalent to coding daco->s = 42; a.*s = 42; b.*daco.s=42;

1. Back to pointer daco, it still points at a dynamically allocated Banana. What is equivalent to coding

daco->s = 42;

a.*s = 42;

b.*daco.s=42;

c.(*daco).s=42;

d.(*daco.s)=42;

2. We have the following:

#include

...

vector thevec;

Code a call to function xyz passing thevec.

a.xyz (vector);

b.xyz (vector thevec);

c.xyz (thevec);

d.xyz (vector )

3. Code the definition for function xyz picking up the vector as a local variable named v.

a.xyz (int v []);

b.xyz (v);

c.xyz (vector v);

d.xyz (vector v);

4.Define a vector of integer pointers named thevec.

Group of answer choices

a.vector <&int> thevec;

b.vector thevec;

c.vector * thevec;

d. vector * <&int> &*thevec;

5. Within function xyz, what does this code do?

int n = 9;

v[1] = &n;

a.changes n to whatever is in the 9th element of the vector

b.changes the 9th element of the vector to n

c.sets the second element of the vector to 9

d.points the second element of the vector at variable n

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!