wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CSNP-04103 C++ Chapter 9-2 - Structs

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Struct stores collection of values of different types, how many types?.

a)

Multiple values but only one type at a time.

b)

You can't store different data types values with structs.

c)

any data type including type objects created by the programmer.

d)

any data type except type objects created by the programmer.

2.

How do you call the individual components of a struct?

a)

Share holders

b)

Members

c)

Family group

d)

Associated group

3.

Check-mark below what can you do with a struct ?

a)

Initialization of the structure.

b)

Use of the structure to declare a new variable (instantiation).

c)

Access of members of the structure.

d)

declaration of the structure.

4.

Structs are typically declared as

a)

Local

b)

Global

5.

Select the instruction below that copies the values of a struct into other.

a)

color2 == color1;

b)

color2 = color1;

c)

copy color2 color1

d)

cp color2 color1

6.

Passing a struct to a function as an argument can increase the argument list?.

a)

True

b)

False

7.

Passing a struct by value to a function can be inefficient?

a)

True

b)

False

8.

The statement "employee company[10]; " is

a)

An enum

b)

A dimensional array

c)

An array of type struct

d)

An invalid statement

9.

The statement: char name[10] = "jackson"; is

a)

A string

b)

A c-string array

c)

An array of characers

d)

A arrangement of characters

10.

The instruction "c_str" us used to?

a)

Create a string

b)

It is a compiler directive

c)

Convert a string into a c_str type

d)

That is not a valid C++ instruction