Home > Backend Development > C++ > body text

What are the differences between C and C++?

WBOY
Release: 2023-08-29 09:17:06
forward
1868 people have browsed it

What are the differences between C and C++?

Here are some differences between C and C.

  • Compared with C, C is a subset of C. All valid C programs are valid C programs.
  • C is a structured or procedural programming language, while C is an object-oriented programming language.
  • In C, functions are the basic building blocks, and in C, objects are the basic building blocks.
  • C does not have variable references, while C has variable references.
  • C uses malloc and free for memory allocation, while C uses new and delete for memory allocation.
  • C does not provide direct error handling support, but C supports exception handling, which helps error detection and smooth processing.
  • C does not support function and operator overloading, while C supports function and operator overloading.
  • C does not support generic programming, but templates in C allow writing generic programs.
  • C does not support namespaces, but C supports namespaces.

The above is the detailed content of What are the differences between C and C++?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template