Data Types in C – Data Types in C Programming
Data Types is a type of Data in C programming language, Data Types is very important in c language because Data Types provides size of memory and its data type during variable define, how much memory allocation required to declare any variable this is determine by data types. which type of data you want store in a variable, this is done by C Data types.
Data Types in C tells how much Storage/Memory to be allocated to a variable.
Data Types in C
There are Primary, Derived and User define data types in C programming
Basic Data Types in C language or Primary Data Types
Primary data types are int, float, char and void .
1 – Integer Data Type ( int )
Integer is a numeric data type its stores numbers and digits only like 1 2 4 5 6 7 there are integer value
Note – Integer size depends on C compiler which compiler you are using its 32 bit compiler or 64 bit compiler.
int takes 4 byte space in 32 bit and 64 bit compiler but int size may vary in other compiler, if you are using 16 bit Turbo Compiler int will take 2 byte space in memory.
Integer Data type further categorize in int, short int, long int and long long int is introduced in latest version of C language which is C99 .
Integer – short int
int
long int
long long int
Integer data type store signed integer and unsigned integer value and int keyword is used for integer data type.
2 Byte int can store integer range -32768 to +32767
4 Byte int can store integer range -2147483648 to +2147483647
long int is used when Integer range value is high from above integer range
Character Data Type in c
Character data type is used to store single character value and this take 1 bite space in memory, you can store a single character value like ‘A’ , ‘B, ‘c’, single character value all written inside. char keyword is used for character data type in c