Difference Between C and C++

Note: what the suffix is ​​has nothing to do with what the header file is.

( 1) Hello World! program.

input Output:

       Input: cin>> (meaning to send the contents of cin to a specific variable)

       Output: cout<< (meaning to send the output to cout)

  IDE: Integrated Development Environment

  refactor: refactoring

 

( 2) Object-oriented.

A variable is an object.

Human characteristics: they will bypass the services it provides and directly manipulate the data inside

 

The purpose of writing a program : problem-solving  design ( designs) + implementation (implementations)

 

  Difference: C focuses on procedures, while C++ focuses on objects (what kind of things are there) and doesn't care about procedures

  Objects: Properties + Services

  The object is as shown below:

  


  data + operations

  C: The operation is outside the structure, and the pointer of the structure needs to be passed to the function

  C++: The operation is in the class, let the object do that operation by itself

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325721429&siteId=291194637