C + + Overview

Source: Internet
Author: User


Overview of C + +:
Developed by Bjarne Stroustrup at T-Bell Laboratory, derived from C language, compatible with C language

Compared with Java

Advantages

C + + faster than Java

C + + is more flexible in inheritance and derivation than Java

C + + can be directly inserted into the assembly can directly manipulate the underlying hardware, so the operating system must be written in C

Java to C + + must be done, C + + to get Java is not necessarily

C + + compiled program can run directly, Java needs to install JRE has dozens of MB

Disadvantages

Java is fully object, such as an array in Java is an object, containing the length of this property; Rather than an array in C + + is a pointer. So access to the array, Java will be the boundary check, more secure, but at the expense of speed. Also, because all classes in Java inherit the base class of object, it is possible to associate several unrelated classes with base classes, such as in the same array

The notion that there is no pointer in Java that is unsafe (though the pointer is fast)

Java has a sophisticated memory management mechanism, can automatically garbage collection, the most likely to reduce memory overflow potential, while improving programming efficiency

There are well-established exception mechanisms in Java (not perfect in standard C + +)

When data is persisted in Java, the object itself is in the heap and is connected by a handle in the stack.

Java standard Library is much more complete, compared to C + + In addition to a STL, the actual C + + programming requires a lot of use of 3rd party library

Java because it is to compile the program into bytecode, the runtime requires the JVM to translate bytecode into machine code, so he cross-platform, a compilation run everywhere

Java Native Support Multithreading (C + + is not available by the standard library)

Compared with C

Advantages

C + + is more secure than C, and its compilation system can also check for more types of errors

The most important feature of the C + + language is the support of object-oriented features, although the compatibility with C makes C + + a dual feature, but in the concept of C + + and C completely different, object-oriented features are more obvious.

Disadvantages

C + + is more complex than the C language, the writing process is also difficult, even if you can use the compiler, there may be a lot of problems, and it is difficult to find

Hangzhou uses C + + company has the East communication, Hoi Hong, Dahua, NetEase and so on

C + + Overview

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.