Fandom

C Plus Plus

What are the differences between C and C++

Redirected from Differences in C and Cpp

16pages on
this wiki
Add New Page
Talk0 Share

C vs C++Edit

There are many differences in C and C++, the following is a list of many of these differences

  • A void pointer cannot be implicitly casted to another pointer (eg. char *buf = malloc(10) must be changed to char *buf = (char*)malloc(10) )
  • A C typedef does not allow duplicate names, but C++ does
  • All C enums are of int, but C++ enums do not have to
  • C++ has a built in bool type with true and false
  • In both C and C++, the function void foo (void) means the function takes no parameter. However, in C, the function void foo () means the function takes unspecified number of parameters with unspecified types, while in C++ it means the function takes no parameter.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.