If you want to learn C language, please read this article carefully~ Even if you have never heard of the term C language, you will understand how it works~ It’s that “awesome”.
1. Background of C Language
From my personal experience, regardless of which language you are learning, you should first understand the background of the language you are studying, or its development history.
C language is a type of high-level programming language, which originated from “ALGOL”. In 1987, the American National Standards Institute established the international standard for C language, referred to as “ANSI C”, and since then it has become a widely used programming language.
Advantages of C Language are numerous, mainly including the following four points:
1. It combines the advantages of both high-level and low-level languages, making it an intermediate language.
2. It is a structured programming language, very suitable for structured program design.
3. It offers a rich variety of data types, operators, and functions to choose from.
4. It interacts directly with memory, making it easy and simple to modify and edit other programs and documents.
2. A Little Test: Are You Ready to Learn C Language?
Have you heard of binary numbers, and how they perform calculations? (Basic knowledge of number systems)
Can you name the components of the smallest computer system? (Basic knowledge of computer architecture)
How does a computer store images? (Principles of digitization)
If you can answer these three questions, raise your hand. If you raised your hand, then we can proceed to the next discussion. Otherwise, I will tell you that your most important task right now is to quickly find a book on “Introduction to Computer Science” to supplement your foundational knowledge.
Because—C language, at its core, is a memory-centric programming language. Whether you can understand it largely depends not on your IQ but on whether you have solid knowledge in computer architecture, storage, and principles of computation!!
I want to emphasize that learning any new knowledge comes with certain prerequisites. The prerequisite for learning C language is having a comprehensive and scientific foundational understanding of computer systems. Without this foundational understanding, everything will be very difficult.
Therefore, some students struggle to learn C language not because they lack intelligence, but because they are not prepared.
3. What to Learn in C Language— “Syntax” and “Library”
The key to learning C language is to first understand what you are actually learning.
When I ask this question, some students will flip open their textbooks and point to the table of contents saying, I know, I know, there are variables, data types, loop statements, functions, oh, and pointers, etc.!
What we call “syntax” is the content that is emphasized in introductory textbooks. These include variables, data types, conditional statements, loops, functions, pointers, etc.
This content is relatively dry, but the good news is that it is not difficult; these are all formatted things. As long as you practice more, it will automatically be engraved in your brain and become a subconscious habit.
However, “syntax” itself is actually not very useful. Because it is merely a format specification—you can learn it well, but it won’t guide you to write impressive programs. In software design, the core part still lies in the “library”.
What is a “library”?
Simply put, a library is a collection of C functions that others have written and made available for you to use. All you have to do is call the functions within it to achieve certain functionalities. For example, the printf() function, you surely know, as long as you call this function, you can display a piece of text in that dark window. You may not understand how printf() works internally, but you know that as long as you follow the instructions to call it, you can achieve the corresponding functionality.
This is the library—a collection of functions that others have written, packaged, and presented to you for free use to do various things.
Let me mention a few functions from libraries, such as CreateWindowEx() function can be used to create a window (this function is provided by Microsoft), GaussianBlur() function can be used to apply Gaussian blur to an image (this function is provided by OpenCV), and evhttp_new() function can create an HTTP service program (this function is provided by libevent)…
What other library functions are there? Too many. From controlling network communication, to capturing video frames and analyzing face positions, to encrypting and decrypting local files, even including sending and receiving messages on WeChat, scraping product information from Taobao… The number and usefulness of library functions far exceed everyone’s imagination.
Oh? You’ve never heard of these things before? The textbook didn’t mention them either?
That’s because you are looking at an introductory textbook, which emphasizes syntax and briefly mentions a few built-in library functions of C language. In fact, there are quite a few library functions included in C language, but even more powerful ones are many third-party library functions, such as those I mentioned above.
The key point I want to convey is that library functions are the key to learning C language and applying it in practice!!
Learning to call others’ library functions, and even writing your own library functions, is extremely important.Because a function is essentially a unit of functionality. The more foundational infrastructure you have, the greater your scope for creativity. It’s that simple. This is the second point I need to emphasize: to write practical C programs, a key factor is to study and learn to use various library functions.
Did you see that Wang Er next door wrote a three-dimensional program that can make a colored cube rotate in the air? Quickly find the OpenGL library functions to use. What? Liu Daba wrote a network software that can chat in the local area network? Quickly find the Socket library to use.
Do you see how important library functions are?
However, learning library functions is not isolated. Many library functions require certain domain knowledge to support them. Just like I mentioned in my first point, it requires foundational knowledge. Understanding a library function means not only knowing how to call it but also reflects our understanding of a specific domain—networking, digital imaging, cryptography, operating systems, etc.
4. Basic Learning Process and General Rules
As I mentioned earlier, learning C language mainly starts with syntax, then moves to libraries. To be more specific, it includes the following stages:
Learning basic syntax
Learning a few simple built-in functions of C language
Learning some basic knowledge of program design (data structures, algorithms)
Learning more powerful built-in functions of C language
Learning basic theoretical knowledge in specific application areas (operating systems, databases, networks, images…)
Applying the knowledge learned in the previous stage to further study library functions provided by others (network processing, operating system management, images, cryptography, etc.)
For undergraduate students, focusing on mastering stages 1-4, selectively learning stages 5-6, and creating some small projects is already very impressive. This is the general learning rule. It sounds brief, but achieving it is really not easy.
If you do not like your current job and are considering a career change, and thinking about enrolling in a training class for systematic learning, then come find me~ I am backed by a publicly listed educational institution chosen by 100,000 people every year; with a research team of thousands; learning + employment guarantee, Daren, you can trust us.
Now there is also a free trial course~ Hurry up and make an appointment!
Make an appointment to understand for free in November
A good learning atmosphere in the class,
Daily supervision from the class teacher,
Real-time problem-solving by the project manager,
Teachers guiding you through practical projects,
Not only systematically learning knowledge but also expanding your social circle.
What reason do you have not to come?
In the wind and rain, I am waiting for you at Daren…
— END —
Previous exciting content:
Programmer Jokes |
UI vs. Graphic Differences |
Java Backend |
Fan Bingbing Tax Issues |
Fake Effort |
Midlife Crisis |
October Good News |
Income Ceiling |
Programmer Tears |
Forced Learning Programming |
Choosing a Training Institution |
Daren Students |
Self-Learning UI |
Programming Language Rankings |
Python |
IT Industry |