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
2
Q
Primitive data types
A
Data types provided by default in C++
Includes int, float, bool etc.
3
Q
5 examples of derived data types
A
Enum Typedef Structure Class Union
4
Q
Main advantage of structures
A
Allows more than one value to be returned from a function
5
Q
Two ways of accessing members through pointers to structures
A
(*ptr).memberVar;
ptr->memberVar;
6
Q
Which of the following is allowed?
- aggregate I/O
- aggregate arithemetic
- aggregate comparison
- aggregate assignment
A
Aggregate assignment