When I asked this question, some students would open their textbooks, point to the table of contents and say, I know, I know, there are variables, data types, loop statements, functions, oh oh oh, there are also pointers, and so on!
Unfortunately, if you think that learning C language is just learning these things, you have to correct your view quickly, otherwise the following learning will be difficult. Because I once fell into this pit. This narrow view made me waste a lot of time learning trivial details, and delayed my exposure to more important knowledge. The result was that I had high expectations but low skills - I knew a lot of useless knowledge that others didn't know, but I couldn't write any really decent programs.
The so-called "grammar" is the content that is most emphasized in introductory textbooks, that is, the so-called variables, data types, branch judgments, loops, functions, pointers, etc.
These contents are relatively boring, but the good news is that they are not difficult, they are all formatted things. As long as you practice more, they will be automatically engraved in your mind and become a subconscious habit.
But "grammar" itself is actually useless. Because it is just a format specification. No matter how well you learn it, it cannot guide you to write a good program. Because in software design, the most core part is actually the "function library" part.
What is a "library"?
Simply put, a function library is a C function written by someone else and provided directly to you. You can achieve certain functions by calling the functions in it. For example, the printf() function, you must know that as long as you call this function, you can display a piece of text in that black window. You don't understand the internal working principle of printf(), but you know that as long as you call it according to the instructions, you can achieve the corresponding function.
This is a function library - a collection of functions written by others, packaged and sent to you, which you can call freely to do various things.
Let me talk about a few functions from the function library, such as the CreateWindowEx() function that can be used to create a window (this function is provided by Microsoft), the GaussianBlur() function that can be used to perform Gaussian blur processing on an image (this function is provided by OpenCV), and the evhttp_new() function that can create an HTTP server (this function is provided by libevent)...
What other library functions are there? Too many. From controlling network communications, to capturing video footage and analyzing the location of faces in it, to encrypting and decrypting local files, and even sending and receiving WeChat messages, to grabbing Taobao product information... the number and usefulness of library functions far exceeds everyone's imagination.
Huh? You've never heard of these things? They're not mentioned in the textbooks?
That's because you are reading an introductory textbook that focuses on grammar and mentions a small number of C language library functions. In fact, C language contains quite a few library functions, but there are many more powerful third-party library functions, such as the ones I mentioned above.
The point is, I want to tell you that library functions are the key to learning C language and applying it to practice! !
It is extremely important to learn how to call other people's library functions, or even write your own library functions. Because a function is essentially a functional unit. The more infrastructure you have, the more room you have to play. It's that simple. This is the second point I need to emphasize to everyone. If you want to write practical C programs, a key is to study and learn how to use various library functions.
You saw Wang Er next door wrote a 3D program that can make a colorful cube rotate in the air? Find the OpenGL library function to use. What? Liu Dabao wrote a network software that can chat in the local area network? Find the Socket library to use.
See how important library functions are?
However, learning a library is not isolated. Many library functions require certain domain knowledge. As mentioned in my first point, preparatory knowledge is required. Learning a library is not just about knowing how to call it, but also reflects our understanding of a specific field - network, digital image, cryptography, operating system, etc.
Previous article:The microcontroller communicates with the PLC through the programming port
Next article:Common brands of microcontrollers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- TA0CCR0 interrupt of msp430
- What are the 9 most important applications of the Internet of Things (IoT)?
- MOS tube burnt out
- About CS1256 Analog Chip
- At the same frequency, the impedance of a large capacitor is smaller than that of a small capacitor, and it has better filtering performance for high frequencies. Why do we need to connect a small capacitor in parallel?
- [GD32E503 Review] Part 5: FreeRTOS Project Creation
- I heard that ST has released a LoRa development board, NUCLEO-WL55JC2. Why can't I find any information about it anywhere in the world?
- MT7603EN Supply
- When stm32 writes MQTT, it subscribes to multiple topics. How should the program distinguish different topics when receiving?
- Application Note - Optimizing Capacitance and AC Impedance Measurements Using the 4200A-SCS Parameter Analyzer