Compatibility of C and C++  The C and C++ programming languages are closely related but have many significant differences. C++ began as a fork of an early, pre-standardized C, and was designed to be mostly source-and-link compatible with C compilers of the time. Due to this, development tools for the two languages (such as IDEs and compilers) are often integrated into a single product, with the programmer able to specify C or C++ as their source language. However, C is not a subset of C++, and nontrivial C programs will not compile as C++ code without modification. Likewise, C++ introduces many features that are not available in C and in practice almost all code written in C++ is not conforming C code. This article, however, focuses on differences that cause conforming C code to be ill-formed C++ code, or to be conforming/well-formed in both languages but to behave differently in C and C++. Bjarne Stroustrup, the creator of C++, has suggested that the incompatibilities between C and C++ should be reduced as much as possible in order to maximize interoperability between the two languages. Others have argued that since C and C++ are two different languages, compatibility between them is useful but not vital; according to this camp, efforts to reduce incompatibility should not hinder attempts to improve each language in isolation. The official rationale for the 1999 C standard (C99) "endorse[d] the principle of maintaining the largest common subset" between C and C++ "while maintaining a distinction between them and allowing them to evolve separately", and stated that the authors were "content to let C++ be the big and ambitious language." Several additions of C99 are not supported in the current C++ standard or conflicted with C++ features, such as variable-length arrays, native complex number types and the codice_1 type qualifier. On the other hand, C99 reduced some other incompatibilities compared with C89 by incorporating C++ features such as codice_2 comments and mixed declarations and code. C++ enforces stricter typing rules (no implicit violations of the static type system), and initialization requirements (compile-time enforcement that in-scope variables do not have initialization subverted) than C, and so some valid C code is disallowed in C++. A rationale for these is provided in Annex C.1 of the ISO C++ standard.  void *ptr; /* Implicit conversion from void* to int* */ int *i = ptr;  int *j = malloc(5 * sizeof *j); /* Implicit conversion from void* to int* */  void *ptr; int *i = (int *)ptr; int *j = (int *)malloc(5 * sizeof *j); Though C++ favors this: void *ptr; auto i = reinterpret_cast(ptr); auto j = new int[5];      void fn(void) flack:   int N; int N = 10;  enum BOOL {FALSE, TRUE}; typedef int BOOL;   C99 and C11 added several additional features to C that have not been incorporated into standard C++, such as complex numbers, variable length arrays (note that complex numbers and variable length arrays are designated as optional extensions in C11), flexible array members, the restrict keyword, array parameter qualifiers, compound literals, and designated initializers.     void foo(size_t x, int a[*]); // VLA declaration void foo(size_t x, int a[x])    struct X    int foo(int a[const]); // equivalent to int *const a  int bar(char s[static 5]); // annotates that s is at least 5 chars long  struct X a = (struct X){4, 6}; // The equivalent in C++ would be X{4, 6}.