There are something we should always remember. They are basics and foundations of computing system. You have to master them to write and understand C program very well.
What is the difference between deleting a segment of code and killing a person…?
Cola, My FirstCat
C Programming Language
- C is more than 50 years old, which is still very popular and good.
- C or Non-C. ?
- C is high-level and portable assembly language. Assembly languange is not portalbe. It has to be associated with ISA (Instruction Set Architecture). C is just a thin portable layer above assembly.
- Modern C: ANSI-C/C89/C90 –> C99 –> C11 –> C17 –> C23
- C is a strictly typing and compiling language. You mindset is about CPU, memory, bits and bytes while programming in C.
Compilation
- Each .c file is compiled separately. We can get
.ofiles from.cfiles. Then all .o files are linked together and produce executable binary file. Therefore we havemake -j<N>. - Before compilation, there is a pre-processing step in which all pre-processing macros are executed or replaced. The pre-processing results are normally stored in
.ifiles, which are normally invisible temperory files.gcc -Ecommand gives us .i files. - We can also ask for generate assembly files
.sbygcc -Scommand from .c files. Compile .s file can also give us .o file. - .o files are in ELF format. We can get .o files from .c, .s or objcopy.
.c –> [.i –> .s – >] .o –> ELF
What is Type?
- CPU instructions have different operand length which maps various basic types in C, such as char, short, int, long long and etc.