"jjj"
C Data Types
C Kind Categories (Data Types)
In C, each piece of information has a particular kind — whether it’s a digit, character, or logical decision. These kinds (known as type groups) tell the system how to store, interpret, and manipulate the values.
Mastering these categories helps you use memory smartly and avoid unexpected results.
Basic Data Types
Here's a quick guide to common kind groups you’ll often work with:
| Type Name | Functionality | Storage Size (May Vary) |
|---|---|---|
| int | Whole number (positive, negative, or zero) | Usually 2 or 4 bytes |
| float | Decimal-based numeric value | About 4 bytes |
| double | Higher-precision decimal number | About 8 bytes |
| char | Single letter, symbol, or digit character | Typically 1 byte |
Special Data Types
| Type Name | Purpose |
|---|---|
| long | Wider space whole number |
| short | Smaller range integer |
| unsigned | Only non-negative values allowed |
| long double | Extremely detailed decimal value |
| signed | Includes both positive and negative numbers |
Basic Example
#include <stdio.h>
int main() {
int age = 23;
float weight = 60.5;
char grade = 'A';
printf("Age: %d\n", age);
printf("Weight: %.1f\n", weight);
printf("Grade: %c\n", grade);
return 0;
} Characteristics Of Data Type:
- Each type has size limitations; picking the wrong one may lead to overflow or waste.
- Character values must be enclosed in single quotes ('A', not "A").
- Mixing different kinds (e.g., int with float) in calculations may trigger unexpected rounding or type mismatch.
- Never assume size; always check using sizeof() when unsure.
- Naming a variable should not match reserved type names like int, float, etc.
- unsigned means zero or above only — using it for anything below zero causes logic errors.
- If high accuracy is critical (like in scientific work), avoid float, use double or long double instead.
Prefer Learning by Watching?
Watch these YouTube tutorials to understand C Tutorial visually:
What You'll Learn:
- 📌 #3: Data Types in C Programming | [2025] C Programming for Beginners
- 📌 C_10 Data Types in C - Part 1 | C Programming Tutorials for Beginners