1/14
These flashcards cover key vocabulary terms related to structures and unions in C programming, focusing on definitions and key concepts explained in the lecture.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Structure
A user-defined data type in C/C++ that allows grouping variables of different data types into a single type.
Member
A single variable that is part of a structure.
Struct keyword
The keyword used to define a structure in C.
Dot operator
An operator (.) used to access members of a structure or union.
Union
A user-defined data type that can hold different data types in the same memory location, sharing that memory across its members.
Memory allocation in structures
Each member of a structure is allocated its own unique storage area.
Memory allocation in unions
All members of a union share the same memory location.
Heterogeneous data type
A data structure that can store data of different types.
Homogeneous data type
A data structure that can store data of the same type, such as in arrays.
Accessing structure members
Members of a structure can be accessed using the dot operator.
Accessing union members
Members of a union can also be accessed using the dot operator, but only one member can be accessed at a time.
Data overlap in unions
In a union, changing the value of one member overwrites the values of the other members since they share the same memory.
Array
A linear data structure that stores a fixed-size sequence of elements of the same data type.
Structure vs Array
A structure can hold multiple data types while an array only holds one type; structures are user-defined and arrays are built-in data types.
Instantiation
The creation of an instance of a data structure or object.