These are the most commonly used types for storing simple values.
| Data Type | Description | Size (Typical) | Range (Approx.) |
| int | Integers (whole numbers) | 4 bytes | $-2,147,483,648$ to $2,147,483,647$ |
| char | Single characters/alphabets | 1 byte | $-128$ to $127$ (ASCII values) |
| float | Single-precision decimals | 4 bytes | Up to 6-7 decimal places |
| double | Double-precision decimals | 8 bytes | Up to 15 decimal places |
These types are "derived" from the basic data types and allow for more complex data structures:
Arrays: A collection of elements of the same type (e.g., int marks[5];).
Pointers: Variables that store the memory address of another variable.
Functions: Blocks of code that return a specific data type.
C allows you to create your own types to better represent real-world data:
struct (Structure): Groups different data types under one name.
union: Similar to structures but shares the same memory location for all members.
enum (Enumeration): Assigns names to integral constants to make code more readable.
The void type signifies "no value." It is primarily used:
As a return type for functions that do not return a value.
To create "generic" pointers that can point to any data type.
You can further adjust the size or range of basic types using modifiers:
short / long: Changes the memory size (e.g., long int).
signed / unsigned: Determines if the variable can hold negative numbers (e.g., unsigned int only holds positive values).
Important Note: The exact size of data types can vary depending on your compiler and system architecture (e.g., 32-bit vs. 64-bit). You can always check the size on your specific machine using the sizeof() operator.
Copyright ©2025. All Rights Reserved Emblab THE RAVE INNOVATION