Summary of C + + programming in my eyes-20150602

Source: Internet
Author: User

Intermittent learning a lot of things, there are 51, AVR, ARM, PLC, C\c++, C #, TB, MC, Mql4, Linux .... And so on, near spoon or swallowed, even hungry wolf-like flutter into the inside, slowly accumulation and understanding, a lot of knowledge points have perceptual understanding, more or less understand some, perhaps for memory, will these knowledge point collation collection, is to do a phase of the nature of the summary

Also very welcome the experts of various industries or the great God can find some of this article I understand the error, can give me a message, because I am lack of a lot of knowledge of the overall grasp, just take it for granted that understanding, some are looking for information, some may not check the information or no information can be checked, because it is not a professional trained, Have not learned too much text rhetoric, so say almost plain English, it is such a trick

1: From microcontroller to compiler speaking

For each compilation requirement, the compiler installed on the computer is primarily Dev-c++,vs2012,keil V5, and the GCC under Red Linux and Linux under the virtual machine

Use more or KEIL,VS2012,GCC these three models

Sometimes thinking, what is a compiler, why I define a printf, the screen will show the characters of the specified format

First we have to go back to the single-board machine, I understand the single-board machine is a control chip + a bunch of peripheral circuits. And I use the Keil compiler, which contains a control chip corresponding to the header file, the header file will be a lot of input and output ports are all defined as readable macros and variables, and the frequency of the crystal oscillator to achieve the program cycle, crystal oscillator frequency size determines the operation speed of the microcontroller, of course, and the control chip itself is related to the design, For example, more than 24MHZ crystal oscillator can be error and so on, with this control chip, the control chip inside a lot of registers, and the early compiler, is through the simple machine code, PLC interface voltage similar, output each pin voltage and current to control the circuit

However, because the machine code is difficult to write, and particularly cumbersome, may later developers will be some of the interface group classification, packaging, and then on the overall interface to achieve jump, similar to the assembly language now, this programming has greatly solved the problem of machine code writing, but it is closely related to the hardware, and very poor readability , the requirements of the coding staff is relatively high, this time roughly in about 1965 years

Then came the B language, I did not contact, plus the single-board control chip and the peripheral circuit of the increasingly perfect, hardware has appeared more complex logic, through the assembly may be particularly large, and particularly difficult to maintain, B language may be more abstract, he may have defined some basic data, Perhaps in order to circumvent some of the shortcomings of the Assembly, to define some data to read and write to the register, this is a great progress, it may be the assembly and the B language over there are other languages, at least this idea is a qualitative change, it will be the end of the machine to free people from the

B language development for several years, his problems may also slowly show up, after all, it is only to solve some of the problems of the Assembly, in about 1971 years, a group of American researchers to improve the B language, or just use the B language variables or constants of the idea, the B language more norms, or directly developed another B language, But they are called C, because they think this is more abstract, more normative

Single board or hardware aspects of more perfect, the logic of the control chip is more strong, C language abstraction or readability comes out immediately get a wide range of applications

Here is the main difference between the C language and the B language and the assembly: Of course, this is also a personal understanding of the two languages I also understand, but also welcome the experts to correct

The assembly is mainly to define the jumps between the various registers, and according to the function of each register, it is simple operation, it is based on the hardware of the computer to accept and manipulate the contents of the register, so that time the programmer, need to understand the various registers between the jump and operation, hardware-based restrictions relatively high

But the C language may change this point, its design concept is to be designed from the hardware, it defines a number of special data types, such as shaping, 4 bytes, to specify the second-order column of the data, which is implemented by the compiler kernel, it defines the bool type data type, to represent with the non-gate, With regard to decimals, it has redefined the storage standard for decimals, defined double and single precision, and left 8 bytes of memory space for this data type, as well as rules for memory alignment, in short, these are what a compiler needs to define, possibly in the standard library of the programming language, Then for the compilation of the generated files, the compiler must also have a connector, the generated two-level files and machine hardware connection, the standard of the connection, each development language has a clear specification, so say C or B language, the compilation environment and hardware separation, and the development of a series of data types, and through some operators, Write these data types to the hardware, which is probably what we call stack knowledge, compiled into binaries by compilers, and then connected via connectors

Therefore, the emergence of C language, or the development of C language concept, can be said to be a major step in programming.

All this time, it's been 1979 years ago.

After several years of development, the hardware of the machine has developed greatly, and the hardware aspect may have already appeared the multistage differentiation

As of the 80 's, the computer environment was as follows: China just opened the university, that's when Apple and Microsoft have not yet appeared, Bill Gates may be developing a DOS system at that time, IBM is still the boss of it, jobs may still be in school, the hardware has developed to a plurality of levels, The same American college students are preparing their graduation thesis, he may think C language with the uncomfortable, it is not clear how, the object-oriented thinking in the university student's head, he began to improve the C language, on the basis of C language added classes, inheritance, derivation and other characteristics, The C language from the previous process of direct object-oriented, this object-oriented thinking, is not simply to say that the increase of the characteristics of the simple, is a complete change of thinking, the personal sense of C language is to weave the world into a net, but C + + completely divides the world into blocks

After many years of development, the United States set up the C + + Standards Committee, the standard of C + +, the standard in 98 became a standard, followed by the 03 version of the 11 version, here does not mention

Hardware has developed rapidly, began a diversified, with the previous simple control chip, developed into the computer now CPU i7,e5, simple peripheral circuit, there are also diversified, the original control button developed a computer keyboard, EEPROM may be upgraded to the current machinery and SSD, Clumsy 1602 may be a process of many displays now, with 8 g,16 g of temporary data storage devices, of course, there are also developed elsewhere, such as the Mitsubishi PLC board, walking is the industrial line, mobile phone control chip is a different branch

In the middle of the 90 's, a lot of other languages appeared, for the cumbersome and some complicated operation of C/C + +, there were many programming languages, more convenient to realize customer development

C + + Aspects of the VC6.0,DEV-C++,GCC and other programming environment

What does 2:c++ contain?

This is the core of my writing this text, what is it, need to know what C + + is a master of C + +?

The previous general understanding of the concept of C + +, mainly through a number of data types to control hardware-related, so, roughly the C + + contains what things summed up

1, a series of understanding

C + + defines four basic data types int, float, char, BOOL on the basis of the expansion of a lot of data types, through the new definition or modifiers and other methods, not mentioned here, these data types are entered into memory through the stack, stored in memory, in order to facilitate the management of this data, C + + Also defines the pointer, that is, the number of memory of these data, in order to facilitate their conversion or access, in order to facilitate their transformation or visit, the provision of two symbols, one is the asterisk "*", one is the address character "&", in order to better manage resources, for some data types of the same data type, C + + Introduced the concept of arrays, corresponding to the array of pointers

With the data types above, it is necessary to make a judgment on their relationship or to perform operations on them, and C + + introduces operators and some operator characters.

Some of the molding algorithms, C + + introduced functions, as well as function parameters and return values, and so on a series of arguments returned by the operation, for the flexibility of C + + provides more convenient

For some specific data types, in order to facilitate better management, C + + added enumerations, structs, classes and other complex data types, of course, these types also have addresses, there are pointer aspects of the operation and so on, the data gathered together have some features, so C + + for these composite types of data, Defines the public, protection, and private permissions, the relationship between the various composite structures, public relations, friend relationships, etc.

In order to facilitate the transmission of some features or the transmission of features, C + + introduces inheritance and derivation, and introduces many features such as overloading in functions.

However, these are still limited to some categories, but also can not be more abstract expression of programming thinking, C + + introduced virtual functions and pure virtual functions, the polymorphism of the class to make a strong complement, make the class more abstract and flexible

In order to be more detached from some data types and to be more abstract, C + + introduces templates to the class and function.

The work above is flexible enough, C + + in order to more streamline the amount of code, but also for more convenient code readability, defined the precompiled header and some macro definitions

For a more convenient operation, C + + standard library, for the algorithm, container, IO, debugging, C compatibility aspects of the full complement

The above is the C + + language inside all the content, in the list of categories

1: Data manipulation classes: simple data, arrays, pointers, operators, operands, functions

2: Composite data: Struct and class, permissions, inheritance and derivation, polymorphic, overloaded

3: Standard: C + + standard library, precompilation and macro definition, debugging

,







Summary of C + + programming in my eyes-20150602

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.