Lecture 1: User Defined Data Types (Structures) Flashcards

1
Q

Derived data types

A

Data types defined by the user

May contain a number of primitive data types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Primitive data types

A

Data types provided by default in C++

Includes int, float, bool etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

5 examples of derived data types

A
Enum
Typedef
Structure
Class
Union
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Main advantage of structures

A

Allows more than one value to be returned from a function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Two ways of accessing members through pointers to structures

A

(*ptr).memberVar;

ptr->memberVar;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of the following is allowed?

  1. aggregate I/O
  2. aggregate arithemetic
  3. aggregate comparison
  4. aggregate assignment
A

Aggregate assignment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly