C, this word is usually pronounced as "C plus plus" in the programmer circle in mainland China, while Western programmers usually pronounce it as "C plus plus" , it is a kind of usage A very broad range of computer programming languages.
#C is a general-purpose programming language with static data type checking that supports multiple programming paradigms. It supports multiple programming styles such as procedural programming, data abstraction, object-oriented programming, and generic programming. (Recommended learning: PHP video tutorial)
CPP is another writing form of the programming language C.
It is the abbreviation of "C Plus Plus". is another computer programming language after C language. C programming language supports all C language syntax at the same time. C is similar to C: but C is a process-oriented programming language, while C is an object-oriented programming language. However, the C language maintains compatibility with the C language, which means that the C language can be inserted into the C program without modification. code.
cpp is the suffix name of source code files written in C language. Its powerful support for classes allows it to write better programs.
C not only has the practical features of efficient computer operation, but is also committed to improving the programming quality of large-scale programs and the problem description capabilities of programming languages.
Language features
Support data encapsulation and data hiding
In C, classes are tools that support data encapsulation, and objects are data encapsulation accomplish. C supports data encapsulation and data hiding by creating user-defined classes.
In object-oriented programming, data and functions that perform legal operations on the data are encapsulated together as a class definition. Objects are declared as variables of a given class. Each object of a given class contains a number of private members, public members and protected members specified by the class. Once a well-defined class is created, it can be viewed as a fully encapsulated entity that can be used as an integral unit. The actual inner workings of a class are hidden, and users of a well-defined class don't need to know how the class works, just how to use it.
Support inheritance and reuse
New types can be declared based on existing C classes. This is the idea of inheritance and reuse. Through inheritance and reuse, you can organize the program structure more effectively, clarify the relationships between classes, and make full use of existing classes to complete more complex and in-depth development. The newly defined class is a subclass and becomes a derived class. It can inherit all non-private properties and methods from the parent class as its own members.
Support polymorphism
Use polymorphism to specify performance behavior for each class. Polymorphism forms a tree structure consisting of parent classes and their subclasses. Each subclass in this tree can receive one or more messages with the same name. When a message is received by an object of a class in this tree, the object dynamically determines some usage of the message to be given to objects of subclasses. This feature of polymorphism allows for the use of high-level abstractions.
The combination of inheritance and polymorphism can easily generate a series of similar but unique objects. Due to inheritance, these objects share many similar characteristics. Due to polymorphism, one object can have a unique representation and another object have another representation.
For more PHP related technical articles, please visit the PHP Graphic Tutorial column to learn!
The above is the detailed content of what is cpp. For more information, please follow other related articles on the PHP Chinese website!