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 intMainvoid){4 Chartype;5 Doubleheight;6 7printf"Please choose changetype (f/c):");8scanf"%c",&type);9 if(type=='F'){Tenprintf"Please enter your height (cm):"); Onescanf"%LF",&height); Aprintf"your height is%.2f ft.\n", height/2.4); -}Else if(type=='C'){ -printf"Please enter your height (ft):"); thescanf"%LF",&height); -printf"your height is%.2f cm.\n", height*2.4); -}Else{ -printf"wrong type!\n"); + } -}
"C Language Learning", C Primer Plus, chapter 3rd data and C