| 1. |
How are the following related? 1. Structure and array2. Structure and class |
|
Answer» 1. Structure and array: Structure and array are both derived data types in C++.: a Structure is a user defined data type while an array is a derived data type. Structure is a collection related data items that can be of different data types. Array is also a collection of elements of same data type Thus both array and structured allow several values to be treated together as a single data object. 2. Structure and class: Structure and class are both user defined data types. Structure is a collection of related data items while class is a collection of data and functions. Hence structure plus related functions form a class. |
|