The document discusses data types in programming, categorizing them into primitive and user-defined types. Primitive data types are built-in and atomic, while user-defined types allow programmers to create custom data structures, which can be composite (like records and sets) or non-composite (like enumerated types and pointers). The record data type is highlighted as a widely used composite type that contains multiple fields of different data types, similar to a row in a table.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
6 views10 pages
User-Defined Data Types Lesson
The document discusses data types in programming, categorizing them into primitive and user-defined types. Primitive data types are built-in and atomic, while user-defined types allow programmers to create custom data structures, which can be composite (like records and sets) or non-composite (like enumerated types and pointers). The record data type is highlighted as a widely used composite type that contains multiple fields of different data types, similar to a row in a table.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10
Data types
Primitive data types
• Primitive data types are those variables that can be defined simply by commands built into the programming language. • Primitive data types are also known as atomic data types. User-Defined Data Types User-Defined Data Types • The data types that are defined by the user/ programmer are called user-defined data type. • Sometimes the primitive data types limit programmers’ requirements therefore they end up designing their own data types. • There are two categories of user-defined data types: • Composite • Record data type • Set data type • Objects and classes • Non-composite • Enumerated data type • Pointer data type Composite data type • These are data types that have one or more fields dynamically linked to fields in another data type (primitive data types). • The record data type is the most useful and most widely used. Record data type
• is a data type that contains a fixed number of components / elements
(called fields) which can be of different data types • - a record corresponds to a row in a table. Each field in the record is used to store values of a certain data type. The fields are accessed using the name of the record and the field name. Pseudocode: Define a Record Type TASK 1: