Question: Consider the function definition and array declarations. Which are incorrect calls to the function make_2? Why? (2 correct) (In considering this code, you are to

Consider the function definition and array declarations. Which are incorrect calls to the function make_2? Why? (2 correct)

(In considering this code, you are to ignore the a) b), and so on, at the start of the lines, and consider that this code is to be embedded in a complete and correct program.)

void make_2 ( int a[], int size )

{

for (int i = 0; i < size; i++ )

a[i] = 2;

}

int array1[20];

Select one or more:

a. make_2( array2, 50 );

b. make_2( array2[5],50 );

c. make_2( array, 30 );

d. make_2( array, 10 ); >>>>>replace array with array1 two places

e. "Hey, make_2, come change array1. Its size is 20." //A declaration for parts e) through h). int array2[50];

Which of the following are legal access to the class or struct members? Assume each is outside of the class member definitions, (2 correct)

struct S class C class D

{ { {

int x; int x; public:

int y; int y; int x;

} private: int y;

S s; int z; private:

}; int z;

C c; };

D d;

Select one or more:

a. s.x

b. d.z

c. d.x

d. c.z

e. c.x

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!