Learning Summary
1. The C base data type uses 11 keywords: int, long, short, unsigned, char, float, double, signed, _bool, _complex, and _imaginary.
2. In standard C, integer 0 is false, and integers greater than 0 are true. Char can actually be printed as an integer.
3, octal is prefixed with 0, hexadecimal is expressed in 0x or 0X.
4, can use the sizeof keyword query type length, if sizeof (int). C99 has a portable type (inttype.h): int16_t, unint32_t, etc., mainly for code portability.
5, Programming exercises (title 7):
1 #include <stdio.h> 2 3 int main (void) {4 char type; 5 double height; 6 7 printf ("Please Choos E changetype (F/C): "); 8 scanf ("%c", &type); 9 if (type== ' F ') {ten printf ("Please enter your height (cm):"); scanf ("%lf"); , &height), printf ("Your height is%.2f ft.\n", height/2.4), }else if (type== ' C ') {+ printf (" Please enter your height (ft): "), scanf ("%lf ", &height), and printf (" Your height is%.2f cm.\n ", height* 2.4); }else{18 printf ("Wrong type!\n"); }20}
"C Language Learning", C Primer Plus, chapter 3rd data and C