Intro to C
C exucutes through 6 phases:
- Editor - programming writing code
- Preprocess - preprocessor processes the code
- Compile - compiler created object code and stores it on the disk
- Link - Linker links the object code with the libraries and creates an executable file
- Load - Loader puts program in memory ( RAM )
- Execute - CPU takes each instructon and executes it, storing new data values as the program executes.
Formatting C code with printf:
printf("Integer value is %10.2f", x);
// 10 to add space to the left, -10 to add space to the right
// .2f to format to 2decimal places
Data Types
- char ( string is array of chars )
- int
- unsigned int ( always positive )
- double
- float