This is an objective comparison of the applications, usage and language characteristics of C and C++. The origins and development trajectory of the two programming languages are also discussed.

Comparison chart

C versus C++ comparison chart
Edit this comparison chartCC++
  • current rating is 4.02/5
  • 1
  • 2
  • 3
  • 4
  • 5
(392 ratings)
  • current rating is 4.15/5
  • 1
  • 2
  • 3
  • 4
  • 5
(381 ratings)
Designed by Dennis Ritchie Bjarne Stroustrup
Major Implementations GCC, MSVC, Borland C, Watcom C GNU Compiler Collection, Microsoft Visual C++, Borland C++ Builder, Intel C++ Compiler, LLVM/Clang
Influenced by B (BCPL,CPL), ALGOL 68, Assembly C, Simula, Ada 83, ALGOL 68, CLU, ML
Typing Discipline Static, Weak Static, Strong, Unsafe, Nominative
Paradigms Imperative (procedural) systems implementation language Multi-paradigm, Object-Oriented, Generic, Procedural, Functional, Meta
Usual filename extensions .c .cc, .cpp, .cxx, .h, .hh, .hpp
Influenced awk, csh, C++, C#, Objective-C, BitC, D, Concurrent C, Java, JavaScript, Limbo, Perl, PHP Ada 95, C#, Java, PHP, D, Aikido
Platforms Almost anything on the planet; requires recompile Almost anything, including OS-based and non OS-based platforms
OOP (Object Oriented Programming) Not built in; freedom to setup structures to act like objects. Lacks the ability to declare encapsulation. Built in; size and memory layout of objects is deterministic. Virtual function calls can be done without vtable via CRTP.
Appeared in 1972 1985
Classes Uses structures instead, and hence bestows more liberty to use internal design elements class and struct
Garbage Collection Manual; allows better management of memory. No GC available on the C++ standard library (STD). However, STD provides efficient and deterministic ways to manage resource such as object ownership and reference counting.
Speed C applications are faster to compile and execute than C++ applications +-5% when compared with C if you know how to make a good use of C++. The performance of C++ and C programs can often be equal, since compilers for both languages are mature.
Execution Flow Top to Bottom Top to Bottom
Programming-include #include #include
Programming-String type No native string type; often declared as an array of characters Array, std::string
Programming-input /output scanf for input;printf for output iostream, fstream (std::cin, std::cout)
Code Compiled to native binary executable files using a compiler like bcc. Compiled to native binary executable files
Language Type Procedural Oriented Language Multi-Paradigm Object Oriented Language
Developed by Dennis Ritchie & Bell Labs Bjarne Stroustrup
Object-oriented Not natively Yes
Generic Programming No Yes
Procedural Programming Yes Yes
Functional Programming Yes Partial
Metaprogramming No Yes
Reflection No No
Inline comments delimiter // //
Block comments delimiter /* and */ /* and */
Statement terminators ; ;
Multidimensional arrays supported Yes Yes
Arrays dynamically sized No No
Platform Any that has a compiler Any that has a compiler

Origins of C and C++

Dennis Ritchie of the Bell Labs designed the C, a general purpose computer programming language in 1972 for use with UNIX, an operating system of then. C is predominantly used for system software programming, but is also very useful for creating general application software. Some of the adjectives used to describe C are block structured, imperative & procedural language.

C++(originally named "C with Classes" and still known as the superstructure of C in computer circles) was developed as an enhancement of C by Bjarne Stroustrup in 1983 at the Bell Labs. Stroustrup, in 1979, started by adding classes, virtual functions, operator overloading, multiple inheritance, templates, exception handling etc. The C++ programming language standard was ratified as ISO/IEC 14882:1998 in 1998 and the current version is the 2003 version, ISO/IEC 14882:2003 which is infact the corrected version of the C++ 1998. The "Library Technical Report 1", released in 2005 gives details of extensions to the standard library without being a part of the standar version. A new version of the standard (informally known as C++0x) is under development. C++ has been a highly successful commercial programming language since 1990. Though C++ is royalty-free, its documentation is not freely available.

Usage of C vs. C++

C proved very useful in running applications coded in assembly language because of its strengths like a simple compiler, lower access levels of memory, lower run time support and an efficient constructing language that was in sync with the hardware instructions. Another of its credits is that it is a highly portable (compatible with a variety of OS & Platforms) with very minimal source code changes required. Thus it has enabled remote operations & independence from the hardware. C is also compliant to a variety of standards, making it work with everything.

C++ is known as a mid-level language. Due to the fact that the C++ comprises of both high-level and low-level language features. Some of the adjectives used to describe C++ are static typed, free-form, multi-paradigm and supporting procedural programming.

Stroustrup, while programming for his Ph.D thesis, found that the Simula language had high level features helpful for large software development, but was too slow for practical use, while the BCPL (language) was fast, but too low-level and thus unsuitable for large software development. In Bell labs, he had to analyze the UNIX kernel with respect to distributed computing which created further problems and he set out to enhance C (due to its ultra portable nature) with features from the Simula. C++ was created in 1983 with additional features like virtual functions, function name and operator overloading, references, constants, user-controlled free-store memory, improved type checking and single-line comments with two forward slashes (//). The Cfront (commercial version) was released in 1985 with the class, derived class, strong type checking, inlining, and default argument features. 1985 also saw the release of the The C++ Programming Language, an important reference to the language in the absence of an official standard. This was followed by the release of the C++ 2.0 in 1989 with features like multiple inheritance, abstract classes, static member functions, const member functions and protected members. Features like templates, exceptions, namespaces, new casts and Boolean type were added post 1990.

Along with the language, its library also evolved, with several additions like the stream I/O library, the Standard Template Library etc.

The first editions of the book K & R written by Dennis Ritchie & Brian Kernighan (original name: The C Programming Language) describes their version of C as the K & R C with full specifications, while the later editions include the ANSI (American National Standards Institute) C standards. Some of the salient features described are the introduction of various data types, removal of several semantic ambiguities, omission of other function declarations etc. Even after the introduction of the ANSI C, the K & R C continued to be the most portable programming language for programmers due to its wider compatibilities.

K&R function declarations did not include any information about function arguments leading to non-performance of function parameter type checks, although some compilers issued a warning message if a local function was called with the wrong number of arguments or if multiple calls to an external function used different numbers of arguments. Tools such as UNIX's lint utility were created for checking the consistency of functions used across multiple source files.

Language Characteristics

Characteristics of C

Some of the important characteristics of C are as follows:

  1. Structured programming facilities
  2. Confirming to the ALGOL traditions
  3. Short circuit evaluation – usage of only one operand if the result can be determined with it alone
  4. Static typing system for avoiding unintended operations
  5. Value passed parameters with relevance to pointer value passing
  6. Heterogeneous data combination & manipulation
  7. Reserved keywords and free-format source text
  8. Larger number of compound operators, such as +=, ++
  9. Huge variable hiding capacity, though function definitions being non-nestable
  10. Character – integer usage similar to assembly language
  11. Low-level access to computer memory via machine addresses and typed pointers
  12. Function pointers allow rudimentary forms of closures & polymorphic runtime
  13. Pointer arithmetic defined Array indexing (secondary notion)
  14. Standardized processor for defining macros, including source code files & conditional compilations
  15. Complex Input/Output and mathematical functions with consistent delegation to library routines
  16. Syntax same as “B” (C’s predecessor) but different from ALGOL e.g.: { ... } replaced begin ... end, && and || replaced and & or, which
  17. While B used & and | in both meanings, C made them syntactically distinct from the bit-wise operators
  18. Similarities to Fortran e.g: the equal- sign for assignment (copying) & two consecutive equal-signs to test for equality (compare to EQ) or the equal-sign in BASIC)

Other unofficial features added with time were:

  1. void functions
  2. Functions returning struct or union types instead of pointers
  3. Assignments enabled for struct data types
  4. const qualifier to make an object read-only
  5. Enumerated types
  6. Creationg of tool to avoid the inherent problems of the language

Soon C became powerful enough to have the UNIX Kernel (written in a assembly language) re-written making it one of the first OS Kernels written in a language apart from the assembly languages.

Characteristics of C++

  1. C++ is designed to be a statically typed, general-purpose language that is as efficient and portable as C
  2. C++ is designed to directly and comprehensively support multiple programming styles (procedural programming, data abstraction, object-oriented programming, and generic programming)
  3. C++ is designed to give the programmer choice, even if this makes it possible for the programmer to choose incorrectly
  4. C++ is designed to be as compatible with C as possible, therefore providing a smooth transition from C
  5. C++ avoids features that are platform specific or not general purpose
  6. C++ does not incur overhead for features that are not used
  7. C++ is designed to function without a sophisticated programming environment

Polymorphism, one of the prominent qualities of C++, enablesmany implementations with a single interphase and for objects to act according to circumstances. C++ supports both static (compile-time) and dynamic (run-time) polymorphisms. Compile-time polymorphism does not allow for certain run-time decisions, while run-time polymorphism typically incurs a performance penalty. C++, though considered a superset of C, there exist a few differences causing some valid C codes to be invalid in C++ or to behave differently in C++. Issues like the C++ defining new keywords namely new & class, that are used as identifiers in C. C and C++ codes can be intermixed by declaring any C code that is to be called from/used in C++ with C linkage & by placing it within an extern "C" { /* C code */ } block.

Developments in the two languages

With time, standardization became more and more important because of large numbers of extensions and a random library with growing popularity of the language and the lack of precise implementation of compilers as per the specifications. One of the aims of the C standardization process was to produce a superset of K&R C, incorporating many of the unofficial features introduced subsequently. However, the standards committee included several new features like function prototypes, void pointers, support for international character sets and locales and a more capable preprocessor. The syntax for parameter declarations was also augmented. Post 1970s, C replaced BASIC as the leading language for microprocessor programming and became popular with its collaboration with the IBM PCs. Meanwhile, Bjarne Stroustrup and others at Bell Labs began work on creating the C++, which added object-oriented programming language constructs to C. Further, ANSI formed a committee in 1983 called X3J11, to establish a standard specification of C and in 1989, the standard was ratified as ANSI X3.159-1989 "Programming Language C." This is the version of C that is often referred to as ANSI C, Standard C or C89. C90, introduced in 1990, was ame as C89 barring a few minor changes. While C++ evolved rapidly, C remained static until 1995 when the Normative Amendment 1 created a new standard which underwent further revision, leading to the publication of ISO 9899:1999 in 1999. This standard is commonly referred to as "C99." It was adopted as an ANSI standard in March 2000. Some of the newer functions are mentioned below:

C++, while continuing to evolve to meet the requirements of the future, a newer version called C++0x denoting that it is expected to be released before 2010 is currently being developed. Indications suggest that C++ will continue to capitalize on its multi-paradigm nature and notable improvements may be native support for threading and concepts thereby making working with templetes easier. More controversially, adding garbage collection is currently under heavy discussion. A group called, that advises the C++ standards committee on good features and improvements required, is working extensively to develop C++ in its current form with expanded functional and metaprogramming abilities.

In The Design and Evolution of C++ (1994), Bjarne Stroustrup describes some rules that he used for designing the C++. Knowing the rules helps to understand why C++ is the way it is. Much more detail can be found in The Design and Evolution of C++.


C’s influence can be traced to works like awk, csh, C++, C#, D, Objective-C, Concurrent-C, BitC, Java and JavaScript, Limbo, Perl, PHP, etc. Some of the major implementations of C include the Borland C, Watcom C, GCC & MSVC. C++, to its credit has influenced other works like D, C#, ADA 95, Aikido, Java & PHP.

Criticisms of C vs. C++

Despite its popularity, C has been criticized for having desirable operations being too hard to achieve and undesirable operations being too easy to accidentally invoke thereby involving more programmer skill, experience, effort, and attention to detail than other programming languages for the safe & effective use of the language.

When object-oriented languages became popular, C++ was an extension of C that provided object-oriented capabilities with C++ originally implemented as a preprocessor -- source code was translated into C, and then compiled with a C compiler.

C++ being derived from C, also happens to inherit most of the criticisms leveled against C. But since the language is actually a composition of two different languages, along with the load of huge programs, often end up making the compilation huge and inappropriate in terms of pure size. When this problem is tried to be avoided, by disabling some of the fringe codes, it was again criticized for losing out on several important utilities. The creator of C++ also feels that C++ is justified to be a complex language since the modern day programming requirements have also increased in a huge manner when compared to the yesteryears.


Share this comparison:

If you read this far, you should follow us:

"C vs C++." Diffen LLC, n.d. Web. 17 Sep 2018. < >