Data Types

 Data Types

  • In the declaration of every variables it is mandatory to specify it data type.

  • It is representation of a data

Classification  of data type

Basically three types

  1. Primitive 
  2. Derived 
  3. User-defined 

1.Primitive Data types:-

  • It is subdivided into sub data types
  •  Data we are storing with the help of the size of the data
  1. int
  2. char
  3. float
  4. void

2.Derived datatype:-

  1. Array
  2. String 
  3. Pointer 
  4. Functions

3.User-defined :-

  1. Stretcher 
  2. Union
  3. typedef
  4. enum

The memory size of the basic data types may change according to 32 or 64-bit operating system.Let's see the basic data types. 

Data TypesMemory SizeRange
char1 byte−128 to 127
signed char1 byte−128 to 127
unsigned char1 byte0 to 255
short2 byte−32,768 to 32,767
signed short2 byte−32,768 to 32,767
unsigned short2 byte0 to 65,535
int2 byte−32,768 to 32,767
signed int2 byte−32,768 to 32,767
unsigned int2 byte0 to 65,535
short int2 byte−32,768 to 32,767
signed short int2 byte−32,768 to 32,767
unsigned short int2 byte0 to 65,535
long int4 byte-2,147,483,648 to 2,147,483,647
signed long int4 byte-2,147,483,648 to 2,147,483,647
unsigned long int4 byte0 to 4,294,967,295
float4 byte
double8 byte
long double10 byte


Comments

Popular posts from this blog

Problem solving using computer

Error and type of error