Saturday, 18 April 2015

PART 3

Data Type: Data type is nothing but the type of data which tells the what is the maximum and minimum value of that data and which operations can be done on that data. There are basically two types of Data Type.
1. Built in or Primitive
2. User Defined or Non-Primitive
Below image make you understand this-
In the above figure I did not show the User Defined because you need some basic knowledge of the coding to understand that don't be panic I will cover the topic later...
Now to Implement or Declare a variable as Integer, C provides a keyword for that 'int' ,'long int','short int', 'signed int', 'unsigned int'  and for reals it provide 'float','double','long double' and for characters it provide 'char' .
Every type has its own boundary of value. i.e., int has the minimum value of -32768 and the maximum value is +32767 but for unsigned int it is 0 to 65535. int is generally means signed int. and char which mean signed char has -128 to +127 and for unsigned char it is 0 to +255 and other data types also has limits of value.
This topic of data type is incomplete without knowing its format specifiers. So, let discuss some basic things about format specifiers. Format Specifiers are some group of characters followed by '%' which tells the compiler to store data in memory with particular format or type and after seeing the format specifier compiler treat the value as per its format and reserve bytes of memory for it.
The common format specifiers are given below-
 Many more format specifiers are available in C, I will discuss it later in time

No comments:

Post a Comment