Tuesday, November 07, 2017

Data Types in C

Types
Data Types
Basic Data Type
int, char, float, double
Derived Data Type
array, pointer, structure, union
Enumeration Data Type
Enum
Void Data Type
Void

A data type specifies the type of data that a variable can store such as integer, floating, character etc. There are 4 types of data types in C language.
1.7.1. Basic Data Types:

            The basic data types are integer-based and floating-point based. These are also called as scalar data types. C language supports both signed and unsigned literals. The memory size of basic data types may change according to 32 or 64 bit operating system. Let's see the basic data types. It size is given according to 32 bit OS.

Data Types
Memory Size
Range
Data Types

Memory       Size
Range
Char
1 byte
−128 to 127
short int
2 byte
−32,768 to 32,767
signed char
1 byte
−128 to 127
signed short int
2 byte
−32,768 to 32,767
unsigned char
1 byte
0 to 255
unsigned short int
2 byte
0 to 65,535
Short
2 byte
−32,768 to 32,767
long int
4 byte
−2147483647 to +2147483647
signed short
2 byte
−32,768 to 32,767
signed long int
4 byte
−2147483647
to +2147483647
unsigned short
2 byte
0 to 65,535
unsigned long int
4 byte
0 to 4294967294
Int
2 byte
−32,768 to 32,767
float
4 byte
1.2E-38 to 3.4E+38
signed int
2 byte
−32,768 to 32,767
double
8 byte
2.3E-308 to 1.7E+308
unsigned int
2 byte
0 to 65,535
long double
10 byte
3.4E-4932 to 1.1E+4932
Remaining data types will be studied later.
Post a Comment

C language Introduction

The C Language is developed for creating system applications that direct interacts to the hardware devices such as drivers, kernels etc. C...