Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Are BWS and RTS necessary evils for the legal system?

Answered: 1 week ago