“This is the third day of my participation in the Gwen Challenge in November. Check out the details: The last Gwen Challenge in 2021.”
Hello everyone, I am the second brother!
Yesterday a reader asked me for the learning route of C language. He was a freshman this year and couldn’t understand the code in the book at all.
To tell the truth, freshmen are generally pure white zero basis, can not understand the code of the book is very normal, unless it is primary school, junior high school, high school began to volume computer hardcore youth; Or because of the choice of textbooks.
That happened to be the second brother before sorted out some of the C language learning materials and learning methods, today take this opportunity to do a summary and sorting.
I recommend a book, two video courses and some learning suggestions. If you still can’t understand C language after reading it, come and scold me and punch me, as long as you don’t hit me in the face.
01) Ruan Yifeng’s INTRODUCTION to C language
This tutorial is open source and is hosted on GitHub under a Creative Commons license.
GitHub address: github.com/wangdoc/cla…
Read online at wangdoc.com/clang/
I read it for the first time, benefit a lot! Can say that I have seen the best C language tutorial, no one! The vast majority of domestic colleges and universities, freshman will arrange C language this course, Ruan Yifeng teacher of the “C language introductory course”, is absolutely Gospel ah.
Ruan Yifeng teacher’s works, we must have heard, hardcore at the same time, but also easy to understand, loved by the majority of readers.
I compiled a PDF version at the first time, and I took a screenshot to give you a taste of it. I am very satisfied with this tutorial, which covers all the places and gives many examples, which are essential for beginners.
I put it on GitHub, need to self help: github.com/itwanger/Ja…
02) C language video class by Professor Weng Kai
Spend a month going through the introduction to PROGRAMMING C video course on MOOCs.
Video address: www.icourse163.org/course/ZJU-…
Here’s the least you can learn from watching these videos:
After taking this introductory course, you can take the advanced version. The course starts with a graphics game program under Windows, with the help of a C language graphics library, all the teaching content is very interesting.
Video address: www.icourse163.org/course/ZJU-…
I’ll give you some tips on how to watch the video.
Listen to the teacher honestly, take notes, and finish the homework strictly according to the requirements of Teacher Weng Kai. If you still have room, think about the questions you’ll be asked after class. If you don’t have ideas, read others’ discussions first, and then gradually learn to summarize yourself.
There is no impossible C language, only the wrong learning posture.
03) Why learn C?
Why learn C? What can you do with LEARNING C? If these two problems are not clear, it is easy to miss the target in the process of learning.
C was invented by Dennis Ritchie of Bell LABS between 1969 and 1973.
Dennis Ritchie says of his own son: “Eccentric and flawed, but also a huge success.” Indeed, the pointer to C language has discouraged many beginners, but if you are lucky enough to pass this barrier, it can be said that the potential is unlimited.
First, THE C language in the computer field plays a link between the past and the next.
C is very concise, with almost no redundancy. The difficulty of getting started is almost zero, and with the exception of Pointers, the basic syntax is easy to learn. Many programming languages are influenced by C, such as Java, C++, C#, Python, Go and so on. If you learn C, it will be much easier to learn other programming languages.
In addition, most of the Unix kernel, as well as all the supporting tools and libraries, is written in C. So that almost all operating system kernel use C language, such as Windows, Linux, macOS and so on. That learned C language, you can learn computer composition principle, operating system and so on partial basic computer basic knowledge.
No one would disagree with the phrase “one ring to them all” in The Lord of the Rings, which could be replaced by language.
Second, C language can be used for the development of embedded systems
In addition to the writing of computer operating systems, C language is now mainly used for the development of embedded systems, cars, cameras, household appliances and other equipment underlying systems are written in C language.
C’s ability to manipulate hardware directly, manage memory, and interact with the operating system makes it a very low-level programming language, perfect for programs with very high performance requirements.
04) Summary of C language core knowledge points
In order to facilitate everyone’s learning, I summarize the core knowledge points of C language here.
Let’s start with the text version:
- The data type
- Operators and expressions
- Input and output
- Process control
- function
- An array of
- Pointer to the
- The structure of the body
- File operations
- Memory management
Here’s a more detailed mind map:
C has two key parts:
The first is syntax: the most important thing in a beginner’s book: variables, data types, branching judgments, loops, functions, Pointers, and so on.
The second is a function library: simply put, a function library is a C function written by someone else that you can call, such as printf(), and print it on the screen. A lot of people might think that library functions are not important, that they are wrapped up by someone else and you just need to remember the name of the function, but what I really want to say is that library functions are the key to learning C and putting it into practice.
Learning to call other people’s library functions (such as malloc function, calloc function, realloc function, free function) gives you the opportunity to write your own library functions, otherwise it is not practical to start from scratch.
05) Some suggestions for learning C language
Generally speaking, C language learning can be divided into the following five stages:
- 1) Learn basic grammar
- 2) Learn to use C language built-in library functions, such as printf level
- 3) Learn to use some basic data structures and algorithms
- 4) With a certain foundation of C language, I began to learn some core knowledge of computer, such as operating system and computer composition principle
- 5) Start to make some LABS, build some simple wheels and realize some simple small applications
Here I recommend 2 free LABS on the blue Bridge cloud class, you can practice them.
1) A calculator that can add, subtract, multiply and divide
Courses address: www.lanqiao.cn/courses/75
Through this lab, you can learn:
- Calculator Design Idea
- C language format check
- C language input and output
2) Implement your own programming language
Courses address: www.shiyanlou.com/courses/670
Through this lab, you can learn:
- The parser
- Polish expression
- Parsing tree calculation
- S-Expression
- Variable definition and usage
- conditional
- Regular expression
- Recursively analyze long strings
- Error handling
- Q-Expression
- function
- string
Build your own Lisp
buildyourownlisp.com/
If you have a solid English foundation, you can read the original version directly.
Seriously follow these lab, real skills learn hand.
06) Other resources for learning C
For junior high school students to see the “AHA C language”, simple and easy to understand, lively and interesting, although can only learn C language tip of the iceberg, but also worth.
C Primer Plus, an introductory book for high school students and freshmen, has comprehensive grammar coverage and many details. The knowledge points are clear, but the shortcomings are trivial and the details are meander.
There’s also the C Programming Language, which is written by the father of C, so it’s all about the heart of C. Most of the code examples are library function implementation methods, the content is concise, clean, no nonsense.
to
- Someone who wants to be a big shot
- Want to advance to C language
- Want to understand Pointers and memory
- Trying to understand the Linux kernel
- You want to do gay stuff
- I want to do microcontroller
- Want to work at Microsoft to improve Windows
- Want to get close to the hardware of life, such as alarm clock, timer, simple robot
Advanced books: C Traps and Pitfalls, C Expert Programming, C and Pointers
So far, the focus of C language is all drawn out, the rest of the study is up to you. Finally, the second brother said a few more words:
1. Self-study is the absolute truth. Strong self-learning ability is the root of solving problems alone, and programmers need to have strong self-learning ability.
A person can go fast, but a group of people can go further. It is best to join some atmospheric technical exchange groups, make friends with one or two capable peers, learn and improve.
3, in the entry stage, coding is the main, video is the auxiliary, do not get it backwards. Remember this formula: all + without practice = fake tricks.
4, if you don’t want to be an excellent engineer in the future, don’t want to go further in the computer road, just want to lie flat as a flat light code farmers, then I recommend a way: follow the teacher step by step, follow the university teaching plan, step by step.
These four tips apply not only to C, but to any programming language. If you keep doing this, in a few years you will be an engineer who is good at solving practical problems, rather than an ordinary coder.
Above, I hope I can help you!
Nothing keeps me here but purpose, and though there are roses by the shore, and trees by the shore, and still harbours, I am not tied.