Data types in programming languages define the type of data that can be used and manipulated within a program. Different programming languages may have different sets of data types, but some common ones include:
Integer: Represents whole numbers without any decimal points. Examples include 0, 1, -5, 100, etc.
Floating-point: Represents numbers that have a fractional component, such as 3.14, -0.001, 2.5, etc.
Boolean: Represents a binary value that can be either true or false.
Character: Represents a single character, such as ‘a’, ‘X’, ‘3’, etc.
String: Represents a sequence of characters, such as “Hello, World!”, “123”, “true”, etc.
Array: Represents a collection of elements, where each element can be of any data type. Arrays can be homogeneous (containing elements of the same type) or heterogeneous (containing elements of different types).
Structure: Represents a collection of related data items under one name. Each item in the structure can have its own data type.
Pointer: Represents a memory address that points to another value stored in memory.
Function: Represents a block of code that performs a specific task. Functions can have parameters (input values) and return values (output values).
Null: Represents the absence of a value. It is often used to indicate that a variable or object does not currently have a value assigned to it.
Undefined: Represents a variable that has been declared but has not been assigned a value.
Enumeration (enum): Represents a set of named integer constants.
Share via: