Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions