Summary of C ++ Study Notes

Source: Internet
Author: User

Many programmers have learned C ++ and concluded that C ++ is an independent language rather than a C language, you can directly learn C ++ without having to start with C. Next, I will share my C ++ learning experience with you, hoping to provide useful information.

I 'd like to talk about the C ++ getting started. I think you have some knowledge about this concept. Let's talk about it in a few more words: the so-called library is a collection of many program codes: during programming, there will be many common functions. If every program that uses these functions needs to be written from the beginning, there will be unnecessary repetitive work; therefore, people have compiled these common functions and organized and encapsulated them according to certain logical relationships, so that they can be called directly during programming and become a library.

How are program modules placed in the library? Well, first of all, we will naturally think of encapsulating those common functions into corresponding functions, so that when the program needs to use these functions, we will call the corresponding functions. A library composed of these functions can naturally be called a function library. Obviously, the idea of the function library is process-oriented;

Secondly, we can encapsulate the tasks to be implemented into class classes. For example, if a library contains the File operation function, the designer may write a File class, it may have methods such as open, close, reset, read, and write, and some internal data structures that save file information.

These libraries are called class libraries and are object-oriented. Therefore, databases can be divided into function libraries and class libraries according to organizational thinking. Standard and non-standard databases are another classification method. If a library is required by the C ++ language standard, such as STL, containers and Related algorithms such as vector and list which are commonly used in C ++ are part of STL ).

Is a part of the language, known as the C ++ entry-level learning has been standardized, regardless of VC, C ++ Builder or other C ++ compilation platforms, it must be included to be "true" C ++ ). Of course, the scope of the standard library is relatively narrow, and other software vendors or organizations, such as MFC, VCL, and Qt, have compiled their own libraries, it is not a C ++ standard that books that simply introduce C ++ will not introduce them.) It is not a part of the language, so it is not a standard library.

Application Programming Interface) is a function provided by the operating system for programmers. You need to write a program on an operating system, and every action depends on the operating system: You need to read a file or draw a dot on the screen, in the end, the operating system is required to implement it for you, and these "requirements" methods, or "Dealing with the operating system" methods, are implemented through programming interfaces.

In DOS, the function implemented by the programmer is ultimately "tell" the Operating System by Means of interruption, so that it can be completed for you. Therefore, it can be said that the interruption is the dossystem API; in a more complex Windows system, the interruption is too simple and low-level, so Windows provides programmers with a series of functions.

These functions have been compiled and mostly installed along with the system. in the dll file, in most cases, the compiler in Windows will link our program to these function libraries. Naturally, they are called API functions. Windows has thousands of API functions.

Compared with dozens of interruptions in the DOS area, it is much more complicated, providing more and more perfect services than DOS. However, it is impossible to remember the names, call methods, and parameters of these functions clearly when learning. Generally, you can have a rough understanding of some of the most commonly used functions; others are generally on-demand queries. In this regard, MSDN is a very good and probably the most authoritative data set.

First, repeat Bjarne's statement: "Our system is already extremely complex. To avoid the complexity of C ++ getting started learning, we don't need C ++ Linus ), it is nothing more than waste." In all areas where C and C ++ are available, C ++ is a better language than C. When I say "better", I mean C ++ has a safer type check, better abstract mechanism, and better database than C.

Of course, there are exceptions in everything. If project 1 you are working on is not large. 2) No abstract mechanism is used in encoding, or even ADT abstract data types, such as std: complex, which does not contain Polymorphism or inheritance), and RAII does not, the exception is also unavailable. 3) You don't need to connect to the basic library, such as smart pointers and containers that simplify resource management. Maybe you can use C. If you do, you don't have to argue with me because I can't refute you. The fields we are talking about here are roughly the areas listed by Bjarne in the "C ++ Application List.

The bottom line is: Remove unnecessary complexity from C ++, leave essential and important language features, simplify the language model, and eliminate historical burdens. Even the opponents of C ++ may have difficulty finding a reason to say "I still don't need C ++ ". In my opinion, there is only one reason for rational opposition to the use of C ++ for beginners: the confusions brought by the complexity of C ++ offset or even exceed the benefits of the abstract mechanism and library of C ++ in his specific project.

  1. Differences between standard input implementation methods in C and C ++
  2. How does the C ++ compiler allocate storage space for Const constants?
  3. Basic Conception and method of C ++ Class Library Design
  4. Several Methods for converting C ++ Language
  5. How to better compile C ++ code

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.