Question: 1. char val[3]; char *ptr; ptr = &val[2]; a. will assign the value in val[2] to the pointer b. will assign the address of val[2]

1. char val[3]; char *ptr;

ptr = &val[2];

a. will assign the value in val[2] to the pointer

b. will assign the address of val[2] to the pointer

c. results both a and b

d. none

2. Referencing a value through a pointer is called:

a. Redirection

b. Indirection

c. Rerouting

d. Extra-direction

3. _________ type file stream object will allow a program to write data into a file:

a. ifsream

b. ofstream

c. both a and b

d. none

4.

Match the cout with its corresponding output based on the following assumptions.

Addresses in memory:

X1001 X1002 X1003

Variable declaration and initiation:

int val[3]= {1,2,3};

int *ptrVal;

ptrVal = &val[0];

- A. B. C. D. E.

cout << val;

- A. B. C. D. E.

cout << ptrVal;

- A. B. C. D. E.

cout << &val[2];

- A. B. C. D. E.

cout << *ptrVal++;

- A. B. C. D. E.

cout << ++*ptrVal;

A.

X1001

B.

3

C.

1

D.

X1003

E.

X1001

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!