I am a beginner and don't know c++. How should I learn?

Briefly describe the learning process of C and C++. Teacher Xiao Ge is always asked by his classmates how to learn C and C++ so as not to be at a loss and not to learn indiscriminately. After thinking for a moment, here is a general reply. As a family, welcome to clap bricks. 1, you can consider learning c first. Many times, the purpose of learning a language is not to become a language expert, but to become an expert in solving problems. Be a useful programmer and a profitable programmer. Our value will be reflected in the customer's value, not the language. C++ is an object-oriented explanation of C. C++ extends the organizational control method of large-scale engineering applications and complex system structures for C. However, I think C++ is still C in its bones. After all, to solve specific problems, each function is written in C or process-oriented. Therefore, if you want to learn C++ well, I suggest you learn C first, and then discuss the ability to solve big problems. Learn to walk first, then learn to run. 2. In the process of learning C, we must understand the structured programming thinking. Why? I said in a previous article that the development process of software language is a process of data privatization. Large-scale engineering applications emphasize high cohesion, low coupling and modular design, and maintain the maximum flexibility and security of the code. This is the core and soul of modern engineering development. Therefore, it is a very convenient way to get started with C language and understand structured development thinking. Because the function of C is ready to be reused. At the same time, we can learn a lot of structured development thinking from the difference between global variables and private variables in cpp and their usage principles. It is not difficult to start learning C++ C++. Many people find C++ difficult to learn, in fact, because it provides many concepts, especially objects, which are difficult to understand. However, after so many years, I have played down the problem. I think object-oriented is relatively process-oriented, which is only a concrete embodiment of structured programming and an example of compiler providing means to force programmers to follow data privatization, and the core of the relationship between C++ and C is nothing more than that. Now let's go back to C. If we write a global variable into a cpp without declaring it in the corresponding H file, is it the only module that can be used? Is it a private variable? With this understanding, can the class understand? 4. Learn the in-depth skills of C++ on the basis of classes. After so many years of development, C++ actually provides many in-depth concepts, which seem complicated, but in fact I think it is also very simple. For example, templates, my understanding is "classes of classes", don't you think so? Now that the template understands STL, ATL, static template library and dynamic template library, is it still difficult to understand? Is a lot of classes, which can be used to realize many classes needed in applications, without the need for programmers to write them themselves. Ok, STL gets it. Is generic development still difficult? The so-called generic development is actually that I make a template to define a set of algorithm rules. However, I hope that the rules of this algorithm can be further abstracted, and I don't limit the core data types. I can use all kinds of data, so I don't need to rewrite only this part of the algorithm. Do you think this is true? Learning here, C++ and C, is actually almost enough. To learn another language is to seek perfection and blame, which is too much. 5. Learning application development As mentioned earlier, the purpose of learning a language is not to make others think they are experts, but to write programs to make money. Therefore, after learning linguistics, you should learn application development. What is application development? I know a language, but the customer doesn't. The customer said directly. Write me a program under Windows, and what functions do you want. Why Windows? Because I'm used to it. Well, in many cases, application development should respect customers' habits. Generally speaking, language should be combined with the development of specific platforms in order to develop meaningful applications and sell money. Well, generally speaking, the client is Windows and the server is Linux, which are all industry habits. Embedded system is hard to say, there are various platforms, such as Palm, S60, Linux, WinCE and so on. It depends on your target customers. When we choose the target platform, there is a question, which language to choose. Many times, this is the difference between students and business programmers. Students generally have no choice but to use whatever they know, but programmers in enterprises can't. We must first evaluate the demand and see which language is more suitable. If we can't, we must study. Ok, if you choose C and C++, then you need to choose a development platform. Needless to say, VC is the best under Windows, gcc under Linux, and everything else is similar. If we develop VC and use C++, we need to consider learning MFC at this time, because this is Microsoft's standard class library, at least under the Windows platform, it is the most authoritative. Have you seen how many steps we have taken from learning to MFC? Isn't MFC a must for learning C++? 6. Learning MFC Learning MFC, many people began to look at its architecture as soon as they came up, and they were very confused. I still can't understand that module dependency diagram. Hehe, actually it's not. Like learning languages, the purpose of learning MFC is not to become an expert in MFC, but to develop Windows applications with MFC and make money for us. See? MFC is a means, not an end. The purpose is to develop Windows programs. In fact, under Windows, there is a very standard C interface called Win32API, which is the standard programming core of Windows. So the real purpose of learning MFC is to understand the development of Windows programs. It is suggested that you can learn Win32API first. Looks like we're back in C, hehe. Is it useful to learn C at first? 7.Win32APi In fact, Win32API is not difficult to learn, because although it is large and has many interfaces, it is not necessary. We really do a simple Windows application, but we don't need that much. Make a simple dialogue and then realize a function. In fact, most of the interface functions you encounter are commonly used in the future. Skillfully remember the commonly used ones, and it will be ok. The key point is to understand the event mechanism of Windows through WinMain at this time, which is the core. Actually, it's as simple as death. In the past, your program, because there was no system support, had to do many things by itself, such as checking mouse and keyboard input. You need to write an infinite loop and watch it all the time, but Windows says, don't do these things, I will do better than you. Go and play if you have nothing to do. I will put the news related to you in a queue, and this queue is your event queue. If it's okay, just find it yourself. If there is any new news, do something. Just have fun if it's okay. Simple, isn't it? Of course, Windows is a multitasking operating system. Sometimes our logic needs concurrent functions. For example, when I am waiting for mouse and keyboard messages, I need to check whether the printer is ready. Here, I need to understand parallel computing, which has nothing to do with language and operating system. This is another topic, so I won't say much here. You can find the relevant information of thread development by yourself. See, if we want to learn Windows programming well, we actually need to learn not only the language, but also the operating system, the principle of parallel computing, the principle of memory, and maybe sometimes we need to learn a lot of knowledge such as network communication, so we can't become commercial programmers by learning the language alone. A qualified programmer has too much to understand and needs to study extensively. When we understand Win32API and basic window programming, we can go back to MFC to continue our study. Isn't it a bit recursive? Ha ha. 8. It is very difficult to go back to MFC to learn MFC, because it encapsulates too many details and is difficult to understand thoroughly. Fortunately, however, we have Mr. Hou's simple explanation of MFC. Let's take a look at how to change from pure C programming of Win32API to C++ mode of MFC. Seeing this is the fastest. After reading the first six chapters, I have learned it, so I won't say much here. 9, COM COM, COM, COM, I have the biggest headache, hehe. COM is a remote procedure call, that is, the code you requested runs in another process and passes parameters and results back and forth through some communication protocol. That's all. DCOM goes one step further, and the server can be on another computer. In the development of the company, everyone may work together in Qi Xin. If you want to cooperate, it is recommended to use COM more under Windows. I personally like socket communication. In short, COM provides a mechanism for cross-process communication and even cross-machine communication. However, in order to pass various parameters, COM can do anything. It invented the smart pointer, which can point to any kind of data. At the same time, in order to realize smart pointer, it uses a lot of C++ generic designs. See, the basic skills of C++ have come into play, and ATL has also been used. Pay attention to the concept of an interface when learning COM. Because the developers are different people, and the calling program and the service program may not be in the same language, OK, so it is impossible to simply provide a C or C++. H file answer interface. Therefore, COM provides a standard interface, and users can obtain the available interfaces through queries in the program, and then call them with the interface ID. I'm exhausted. After learning COM, we can learn more about ActiveX, and then learn a little about dll (Dynamic Link Library) to write OCX controls. Overall, OCX control is a good design and can be used anywhere. The ideal development of a software module is like this, which is more flexible than exe. 10, it's gone. According to the Shaolin Sect, after learning the above, you have actually fought in the bronze array of 18. You can go down the mountain to help the wise master, wipe out the traitors, turn around Gankun and save the people. However, the key is whether you have learned the learning method through the above process, so it is not difficult to learn when you meet new things. This is probably the understanding in martial arts. With this foundation, as long as you practice slowly in the future, it is estimated that in 20 years, you will be better than all heroes in the world. Hehe, don't you think? Whew, I'm so tired. from

Remember to adopt