Home  >  Article  >  Backend Development  >  How to become proficient in C language?

How to become proficient in C language?

little bottle
little bottleOriginal
2019-05-08 17:40:4726813browse

Many people know about C language. There may be many people who have studied it in college or even middle school. They may be familiar with it or only understand it. Those who can say that they are proficient should be able to cut off most people on the basis of the previous ones, so Some people want to know, how can I become proficient in C language?

How to become proficient in C language?

1. First have a certain computer foundation and be prepared for subsequent improvements

is a person who has a professional background and directly learns C language , it is easy to master, relatively speaking there are fewer obstacles. If you are not a computer major, basic mechanism conversion will be a problem. Later, when you learn more difficult technical points such as pointers, the lack of some basic links will be exposed. Let’s take a simple example: shift operation. If you don’t understand decimal conversion, When it comes to binary, the rules of high eight bits and low eight bits, it is difficult to understand without some basic knowledge. The editor recommends a learning skirt for learning C/C [627, 012, 464]. Whether you are an expert or a novice, want to change careers or want to join the industry, you can learn about it and learn together! There is a lot of useful information and technical sharing in the skirt!

This is why many non-computer majors who want to learn programming have always recommended the principles of computer composition.

For computer majors, you can start learning C language directly. You need to choose a relatively good book. The current books with good reputation are also good. There is no need to buy them all to learn. It is the first time to learn. This book is enough. I recommend the C programming language and C primer plus. These two books have been used when getting started. I think it's pretty good.

2. Now that you are ready, how to learn and what strategies should be followed during the learning process?

Now that we have a certain foundation and the books are ready, some people will definitely say that it is also good to follow the videos to learn. Video learning is simple and clear, and the teacher in it explains it clearly. Why should we choose to focus on books? Many people like to watch martial arts TV series. People who have read the original works will always feel that something is missing when they watch the TV series. The video is a process of highly refining and concentrating knowledge, so it looks very simple and direct, and it seems easier to follow. study. After the language is processed and refined, people can understand it as soon as they hear it, but this process of processing and refining is not done by the people learning programming themselves.

Learning programming is essentially a process of establishing your own knowledge system. The establishment process requires a process of improving thinking and cognition. Things in books are more abstract and seem to give your brain more room for daydreams. It’s easy to let yourself use your brain. The point I want to emphasize here is not to say that it is wrong to watch videos to learn. You can watch them selectively. Based on books, if you encounter something you really don't understand, find the corresponding knowledge point, watch the video and learn it, and then return to the book. During this process, many people felt that I could understand it very clearly even after watching the video, but I couldn’t write anything without the video. The reason is that understanding clearly and understanding through practice are two different things. Practice more is the last word.

3. Master several common knowledge points

Data types, arrays, functions, pointers, structures, preprocessing, files, etc. piece. The real difficulty is concentrated in functions, pointers, and preprocessing does not seem difficult. At the bottom of many large-scale software, macros are used to implement many functions directly from the perspective of efficiency. Beginners should not think so much.

Pointers are the core of the entire C language. Callback functions and data structures all revolve around pointers. Many data structures are focused on learning in a special book. Essentially, they are a combination of pointers and structures to form various data structures, such as binary trees, trees, linked lists, etc.

For the understanding of pointers, a pointer is a variable, but this variable is slightly different from an ordinary variable. It stores an address. This address will point to a memory area. This area can store any value and can also continue. This is how the secondary pointer comes to store the address. The pointer must be initialized before use. Initialization is essentially to find a real memory area for this pointer. It sounds simple, but in actual use, beginners often make various mistakes, which is normal. Start digging the hole, and then slowly fill it until you understand what it means. This period may be more painful, but it is not that difficult to get through it and see again.

When you encounter a bottleneck in the learning process, you can look for the corresponding video and watch it, or you can leave a message to express your confusion. The knowledge points are limited to those few, and each one is missing. It will come to an end.

After mastering the general knowledge points, you can find some small projects to practice, such as Snake, Tetris and other games. The amount of code is relatively small, but it can also improve your coding ability and knowledge recognition from the side. degree of knowledge.

4. How to improve in depth

The difficulties in using C language to do projects mainly include three points: finding memory leaks, improving system performance, and building a reasonable framework.

Since C language pointers need to be initialized when used, they basically require memory application. If the memory is not released in time, continuous application will cause memory leaks. To find memory leaks, you need to write a hook function yourself to capture how many people have applied for memory, then grab the release function, grab the data, and compare it based on the address of the pointer to see if there is an address that only applied for memory but did not release it. After catching it, find the corresponding code and modify it directly.

There are generally two strategies for solving system performance. Re-examine the code logic and eliminate it bit by bit through debugging or printing. Doing this kind of work is tedious and requires the ability to grasp the specific overall situation. There is one Intuition for the code is included.

The requirements for building a framework are higher. The framework of the design module generally follows a high cohesion and low coupling strategy. However, in the actual development process, many calls may be made directly for convenience. It is considered a very high level of software development.

The content mentioned in this part may still feel relatively far away for beginners. It is basically something that programming veterans do. There will always be a process from novice to expert. Don't think that you have no hope because your current level is very poor. It all requires a process. A thousand miles begins with a single step.

As a beginner, you can take a look at what stage you are at now, how far the gap is, and how far you still have to go. If you know yourself and your enemy, you can fight a hundred battles without danger.

The above is the detailed content of How to become proficient in C language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn