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
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
d.xyz (vector v);
4.Define a vector of integer pointers named thevec.
Group of answer choices
a.vector <&int> thevec;
b.vector
c.vector *
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
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