Course Address: https://www.cc4e.com/
Learning C language programming is to understand the principles of computer operation from a historical perspective, which leads to computer architecture.
The instructor does not teach us how to code in C language, but rather explains how computers work and how other languages utilize C language.
Course Outline
Chapters 1-4 mainly cover syntax, which is just another programming language. If you have a background in other languages, you will find it not difficult.
Chapter 5 covers pointers and arrays.
Chapter 6 covers structures.
Chapters 7-8 detail C language features (we will skip some details).
Chapters 5-6 are challenging, while Chapters 7-8 are supplementary.
Chapter 1
Sections 1.1-1.5 are just another programming language.
Section 1.6 discusses arrays, static arrays, which must be declared with a length in advance and cannot be adjusted until Chapter 5, where pointers and dynamic memory are discussed.
Sections 1.7-1.8 cover functions and parameters, where early stages are call-by-value, and call-by-address (reference call) starts from Chapter 5.
Section 1.9 discusses character arrays, using a bit of pointers. Pay close attention to this part because there are no string objects in C.
Section 1.10 covers function scope.
Note the size of character arrays; exceeding the length will result in an error.
90% of security issues in the computing field are related to C language, including some overflow issues that can lead to vulnerabilities. This is why we do not use C to write applications.
In many other languages, single quotes and double quotes can be used interchangeably because their handling is similar, but not in C. In C, double quotes denote character arrays, while single quotes denote single characters, and they automatically append a null character at the end, whereas strings in Python and similar languages have a defined length.
Character Set
The character type in C language is just a number, and what character it represents depends on the character set.
C language uses ASCII, while most modern languages use multi-byte Unicode, which may be represented in UTF-8 format.
The instructor prefers using octal and hexadecimal because they can be bit-converted to binary.
How is the “string length” in C language obtained? Through a for loop that finds the ‘