How to start learning C/C++ language with zero foundation, he did this.

If you plan to develop in the C++ direction in the future, it is also recommended that students who have no programming foundation start with the C language, master the C language and process-oriented programming ideas, and then learn the C++ language with the same line. Not only can you learn two scientifically The most mainstream development language in the computer world, you can also experience the changes in the development of software development ideas, and have the effect of comprehending by analogy.

How to learn C++ independently?

First, a good C++ book (Accelerated C++, C++ Primer), and then as many exercises as possible to complete the book, can help complete the study of C++ grammar.

Although some books cover the standard library, they are not complete enough. At this time, you can choose to read the C++ Standard Library online, which is a generic learning method, or you can choose to read the "C++ Standard Library" to learn. Through such steps, you should be able to complete the initial learning of C++.

Then, because C++ is a system-level language, when you need to learn the operating system, you will understand the deeper meaning of stack and heap, memory management, etc. However, before you understand these concepts, it will not prevent you from doing things with C++, such as writing a simple XML Parser. At this time, you should find many problems, such as efficiency, code specifications, etc. At this time, you can study Effective C++, Google C++ Code Standard, etc. Only when you make a mistake, you will be more profound if you look back.

Later, you can think about C++ more deeply, you need to read "The Design and Evolution of C++". Reading this book will teach you a lot, and it is the C++ book that has the greatest impact on you. If you are interested in some details of the C++ compiler, in-depth C++ object model can be recommended. If you are interested in some implementations of STL, you can go through the STL source code (many people recommend STL source code analysis, but I have not read it. I have no way to publish opinions on whether to recommend or not. List it for you to judge whether you should read it. ).

At this step, I think you should be able to call it a C++ Programmer. The rest is to discover problems in practice and then make up for yourself. In addition, because C++ is broad and profound, the scope of application is huge, and the knowledge required for a specific direction is not listed. For example, if you want to study Android's NDK or something, that is what belongs to you.

Before learning C++, it is assumed that everyone already has the foundation of C language. If you have not learned C language, I suggest you learn C language first

C++ language is a set of programming languages ​​designed to support object-oriented based on C language, and object-oriented in C++ is the mechanism of classes, so C++ is also called "C language with classes". So what is a class?

Let's start with the structure of the C language, I believe you still have an impression.

Such as C language code

struct stu
{
    int num;
    char sex;
    int math_score;
    int en_score;
    int c_score;
  
};
int main()
{
   struct stu A;
    return 0;
}

The above C code defines a struct stu structure type, which has five member variables, and then defines a variable A of this structure type in the main function. This is the familiar C language code. In fact, The class in C++ is similar, except that it is a bit more advanced than the structure of C. It is not called a structure, it is called a class, and besides it can contain many basic variable types, it can also contain many functions. For a preliminary understanding of a class, we can understand it in general. For example, the corresponding C++ code is:

class stu
{
    int num;
    char sex;
    int math_score;
    int en_score;
    int c_score;
  
    int total_score()
    {
      return math_score+en_score+c_score;
    };
  
};
int main()
{
   class stu A;
    return 0;
}

Let’s take a closer look. C language uses struct definition, C++ uses class definition, and secondly, there is an extra function in C++ class. This is the difference between classes in C++.

In addition, the name is different. The member variables in the C++ class are called attributes, and the functions in the class are called methods. That is, the class has two parts: attributes and methods.

Of course, in addition to this, there are many differences, we will slowly introduce them in the future.

If you belong to a small partner without C language foundation, or a small partner interested in programming C language, you can click below to learn more, get these resources for free, and publish relevant study notes and source code regularly~

Friends who are interested in programming or need resources can follow me to receive information

Guess you like

Origin blog.csdn.net/Python6886/article/details/111217030