Last week, we have started our discussion on the C language. But this week, our lessons focuses on the data types used in programming the C or the Combined Programming Language.
Some of the data types are the char, int, void, the floating, the double floating and some more.
char - values are used to hold ASCII characters or any 8-bit quantity.
int - values are used to hold real numbers. Real numbers have both an integer.
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.
*To declare explicitly a function as returning no value.
*To declare explicitly a function as having no parameters.
*To create generic pointers.
float and double - values are used to hold real numbers. Real numbers have both an integer and fractional component.
The range of char is from 0 to 255.
The range of int is -32768 to 32767.
The range of void is not applicable for it is valueless.
The range of float is 3.4 X 10-38 to 3.4 X 1038 while the range of double is 1.7 x 10-308 to 1.7 x 10308.
C has 32 keywords. Twenty- seven which are given by Brian Kernighan and Dennis Ritchie standard and the five added by the ANSI (American National Standard Institute). 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.
The following are the known 32 keywords:
auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while
Next Week, we will continue discussing more about the C language.
No comments:
Post a Comment