If you’re starting your journey into C programming, one of the first things you’ll encounter is the concept of data types. It might seem like a small thing at first glance — just picking a label for your variables — but trust me, choosing the right data type is one of the most important decisions you’ll make in any program.
In simple terms, data types define what kind of value a variable can hold — whether it's an integer, a character, a decimal, or even something more complex. Without them, your code wouldn’t know how to store or process the information it’s working with.

This article will walk you through what is data type in C, the different types available, real-world examples, and why it all matters. We’ll also give you the inside scoop on how you can learn this and much more through the Data Structures and C Programming Course by Uncodemy.
Let’s answer the question directly:
What is data type in C?
In C programming, a data type tells the compiler what kind of data a variable is intended to store. It defines the size of memory allocated to that variable and how the bits will be interpreted — as numbers, characters, or floating-point values.
Think of it this way: when you tell a friend to store an item, they need to know if it’s a book, a fruit, or a USB drive — because the container depends on the item. Similarly, in C, your computer needs to know what type of data you're storing, so it can choose the right “container” or memory format.
If C didn’t have data types, every value would just be a meaningless pile of bits. You wouldn't know whether 65 represents a character, a number, or something else. Data types bring clarity, structure, and predictability to your program.
Here’s what they help you with:
C provides a range of data types, categorized into:
Let’s look into each category in detail.
These are the foundational types C offers. You’ll use these 90% of the time.
Stores whole numbers, both positive and negative.
Copy Code
c CopyEdit int age = 25;
Used for numbers with decimal points.
Copy Code
c CopyEdit float height = 5.9;
Used when higher precision is needed than float.
Copy Code
c CopyEdit double pi = 3.1415926535;
Stores a single character. Characters are stored as ASCII values.
Copy Code
c CopyEdit char grade = 'A';
These are derived from the built-in types and allow complex storage.
An array stores a fixed-size sequential collection of elements of the same data type.
Copy Code
c
CopyEdit
int scores[5] = {90, 80, 70, 85, 75};Stores the memory address of another variable.
Copy Code
c CopyEdit int x = 10; int *ptr = &x;
In C, functions are technically derived data types because they return values of some specific type.
Copy Code
c
CopyEdit
int add(int a, int b) {
return a + b;
}C lets you define your own data types using these constructs:
Used to group different data types under a single name.
Copy Code
c
CopyEdit
struct Student {
char name[50];
int age;
float gpa;
};Similar to structures, but all members share the same memory space.
Copy Code
c
CopyEdit
union Data {
int i;
float f;
};Gives a new name to an existing type to improve code readability.
Copy Code
c CopyEdit typedef unsigned int age;
Now age is an alias for unsigned int.
Used for variables that can take one of a few predefined constants.
Copy Code
c
CopyEdit
enum day {Mon, Tue, Wed, Thu, Fri};This type indicates no value or empty. It’s commonly used in two places:
Copy Code
c
CopyEdit
void greet() {
printf("Hello!");
}C allows modification of data types using short, long, signed, and unsigned. These modifiers adjust the size or the range.
Takes less memory.
Copy Code
c CopyEdit short int x = 100;
Used for larger numbers.
Copy Code
c CopyEdit long int population = 1000000;
Only stores positive values, doubling the positive range.
Copy Code
c CopyEdit unsigned int age = 30;
Default. Stores both positive and negative values.
Let’s look at how different data types are used in real-life programming.
Copy Code
c CopyEdit int currentYear = 2025; int birthYear = 2000; int age = currentYear - birthYear;
Here, all values are whole numbers, so int is the best choice.
Copy Code
c CopyEdit float temperature = 36.7;
For storing temperatures, float is perfect due to decimal precision.
Copy Code
c CopyEdit char grade = 'A';
Characters like grades are stored using char.
Copy Code
c
CopyEdit
struct Book {
char title[100];
float price;
int pages;
};To manage a book’s info, a struct groups different types.
Knowing the theory is just half the job. To really grasp data types:
And if you're serious about learning C the right way, check this out:
If you want to dive deep into C, explore advanced data types, work on real-time projects, and build a solid programming foundation, then the C Programming Course by Uncodemy is for you.
🎓 Course Highlights:
🔗 Explore Uncodemy’s C Programming Course
Whether you're prepping for an internship, a coding competition, or your college exams, this course makes data types — and the rest of C — easy to master.
Understanding what is data type in C is more than just learning some definitions. It’s about learning how your program thinks, stores, and manipulates data. Each data type brings its own strengths and limitations — and the better you understand them, the cleaner and more efficient your code becomes.
From managing memory smartly to avoiding silly bugs, data types play a role in every aspect of programming. So next time you write int or char, remember — you're telling your computer exactly how to think about that variable.
Choose wisely, code wisely.
Personalized learning paths with interactive materials and progress tracking for optimal learning experience.
Explore LMSCreate professional, ATS-optimized resumes tailored for tech roles with intelligent suggestions.
Build ResumeDetailed analysis of how your resume performs in Applicant Tracking Systems with actionable insights.
Check ResumeAI analyzes your code for efficiency, best practices, and bugs with instant feedback.
Try Code ReviewPractice coding in 20+ languages with our cloud-based compiler that works on any device.
Start Coding
TRENDING
BESTSELLER
BESTSELLER
TRENDING
HOT
BESTSELLER
HOT
BESTSELLER
BESTSELLER
HOT
POPULAR