CMPSC 311 - Types, Structs, and Unions

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/14

flashcard set

Earn XP

Description and Tags

Flashcards reviewing C types, structs, and unions.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

15 Terms

1
New cards

Data Type

An abstraction that allows a programmer to treat different memory ranges as different classes of data.

2
New cards

Strongly vs. Weakly Typed Languages

Programming languages are classified along a spectrum based on how they handle ambiguity in types and usage.

3
New cards

Strongly Typed Language

A language that won't compile if variables of a different type are passed as parameters or compared without explicit conversion.

4
New cards

Weakly Typed Language

A language that attempts to convert values to the correct type when variables of different types are used together.

5
New cards

Static Typing

Type of data is decided at compile time, and type conversion occurs at that time.

6
New cards

Dynamic Typing

Run-time environment dynamically applies types to variables as needed.

7
New cards

Type Casting

Explicitly annotating a type conversion.

8
New cards

Typedef

A way of extending the C type system to declare new types for the compiler to recognize and use. Creates an alias for another type.

9
New cards

Structure (Struct)

An organized unit of data that is treated as a single entity (variable)

10
New cards

Enumerated Type (Enum)

Allows you to associate integer values with names.

11
New cards

Union

A way to overlay different data structures over the same memory region, allowing you to selectively interpret the data in place.

12
New cards

-> Operator

Used to access the fields of a struct when handling a pointer to the struct.

13
New cards

Conditional Operator

Short-hand way of expressing an if-else statement.

14
New cards

Padding

Unused memory added by the compiler to a structure in order to ensure proper alignment of data members, which may be required by the underlying processor architecture.

15
New cards

Bit fields

Create numeric (integer) values that have a very specific width (in bits)