LEARNINGS OF THE WEEK
By: Sharra Mae S. Tagaro IV- Rizal
DATA TYPES
DATA TYPES AND KEYWORDS
There are five elementary data types in C: character (char), integer (int), floating point, double floating point and void.
- CHAR
-Values of type char are used to hold ASCII characters or any 8-bit quantity. Bidwidth-8; range- 0 to 255 - INT
-Variables of type int are used to hold real numbers. Real numbers have both an integer. Bidwidth- 16; range- 32768 to 32767 - Float and Double
-Values of type float and double are used to hold real numbers.
-Real numbers have both an integer and fractional component. Float: Bidwidth- 32; range- 3.4 X 10-38 to 3.4 X 1038 Double: Bidwidth- 64; range- 1.7 x 10-308 to 1.7 x 10308 - Void
-The type void has three uses:
-To declare explicitly a function as returning no value.
-To declare explicitly a function as having no parameters.
-To create generic pointers. Bidwidth- 0; range- valueless
Type Modifiers
-Except type void, the basic data types may have various modifiers preceding them. A modifier is used to alter the meaning of the base type to fit the needs of various situations more precisely.
The list of modifiers includes the following:
-Signed
-Unsigned
-Long
-Short
Keywords
-Keywords in C are reserved words that have a special meaning.
-Reserved words are words "reserved" by the programming language for expressing various statements and constructs, thus, these may not be redefined by the programmer.
No comments:
Post a Comment