wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PDS - 04225 Pointers & Dynamic Arrays - Chapter 8

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

C++ pointers are

a)

Memory locations

b)

always int data type

c)

objects that do not require data type

d)

Variables that point at other variables

2.

C++ Pointer variables contain

a)

Integer values

b)

addresses of locations in memory

c)

hexadecimal numbers

d)

None of the above

3.

In C++ the heap is

a)

A special C++ library that controls the memory

b)

A special variable

c)

An amorphous block of memory that your program can access as necessary.

d)

An perfect block of memory that your program can access as necessary.

4.

In C++ the Memory is broken into individual bytes with each byte carrying it’s own:

a)

Values

b)

Pointers

c)

Scope

d)

Address

5.

The heap is:

a)

Symmetric storage

b)

a special variable

c)

A block of memory that is controlled by the programmer

d)

A block of memory that is controlled by the compiler

6.

What are 2 typical problems with fixed array sizes?.

a)

Exceeding the maximum

b)

Use of For Loops

c)

Use of indexes to access the array

d)

No expansion

7.

What do you use the "new" command in C++ for?.

a)

Create new object

b)

De-reference memory locations

c)

Allocate heap memory

d)

Create arrays

8.

What does this command do?.

a)

Creates a pointer of type integer that is initially pointing to null.

b)

Creates a pointer of type integer that is initially pointing to 0.

c)

Creates a pointer in the heap

d)

None of the answers are valid

9.

In C++ what the following command does: delete [ ] a;

a)

Nothing

b)

Creates a new array names a of type delete.

c)

Deletes a variable

d)

Free memory allocated for the a array

10.

Do you have to reset a pointer after delete?.

a)

Yes

b)

No