Data types: int,float,char,double & void
The size and range of these data types may vary among processor types and compilers.int: Size of int depends on length of a word of execution environment.In General int is 2 bytes for 16bit compiler.Int is used to store integer values.
eg: int a = 35 , int b.
If b value is not specified, a memory of 2 bytes will allocated containing junk values
eg: float b=35.6
Char:Char can be better called as byte for better understanding . As we know machine understands only binary values (0's and 1's) & we cant store character as it is in memory.
Eg: char a='A'
Void:The type void either explicitly declares a function as returning no value or creates generic pointers.
Table below shows all data types defined by C standard
Type Modifier: A type modifier changes meaning of basic data type to fit specific needs.
Type modifiers are: Signed ,Unsigned,Long,Short
Negative numbers are represented using the two's complement approach, which reverses all bits in the number (except the sign flag), adds 1 to this number, and sets the sign flag to 1.
Eg:32,776 in binary
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
1 comments:
The negative range specified in the chart is incorrect for most of the data type.
Post a Comment