C with Classes
C with Classes was the historical precursor language to what would later become C++, both of which were first created by Danish computer scientist Bjarne Stroustrup.[src] As its name suggests, it aimed to extend the C language with object-oriented features, namely classes.[src] The term "C with classes" has also been used colloquially (sometimes disparagingly) to refer to C++ code written as if it were C.[src]
C with Classes was the historical precursor language to what would later become C++, both of which were first created by Danish computer scientist Bjarne Stroustrup.[src] As its name suggests, it aimed to extend the C language with object-oriented features, namely classes.[src] The term "C with classes" has also been used colloquially (sometimes disparagingly) to refer to C++ code written as if it were C.[src] ==History== , the creator of C++, in his AT&T New Jersey office, ]] In 1979, Bjarne Stroustrup began work on C with Classes.[src] The motivation for creating a new language originated from Stroustrup's experience in programming for his PhD thesis.[src] Stroustrup found that Simula had features that were very helpful for large software development, but the language was too slow for practical use, while BCPL was fast but too low-level to be suitable for large software development.[src] When Stroustrup started working in AT&T Bell Labs, he had the problem of analyzing the UNIX kernel with respect to distributed computing.[src] Remembering his PhD experience, Stroustrup set out to enhance the C language with Simula-like features.[src] C was chosen because it was general-purpose, fast, portable, and widely used.[src] In addition to C and Simula's influences, other languages influenced this new language, including ALGOL 68, Ada, CLU, and ML.[src] Initially, Stroustrup's "C with Classes" added features to the C compiler, Cpre, including classes, derived classes, strong typing, inlining, and default arguments.[src] In 1982, Stroustrup began designing a cleaned-up and extended successor to C with Classes, using traditional compiler technology.[src] The language was briefly called C84 before the name C++ was adopted; the name was suggested by Rick Mascitti and refers to C's ++ increment operator.[src] The resulting language included virtual functions, function and operator overloading, references, const , improved type checking, user-controlled free-store memory allocation ( new / delete ), and BCPL-style single-line // comments.[src] Stroustrup also designed and implemented Cfront, the C++ compiler front end, between spring 1982 and summer 1983.[src] ==Language== The language's constructors and destructors, rather than using the class names ( X() and ~X() ), used the new and delete keywords themselves as methods returning void ; these keywords served to replace the C memory allocation functions malloc() and free() .[src] C with Classes lacked the private keyword, and had only a public keyword to declare a public region of the class, while everything before was private.[src] C with Classes, which lacked namespaces, did not use the namespace resolution operator :: for referring to class members; rather, it used the period .[src] , much like C.[src] Providing the definition of a class method inside the class itself inlined the function, avoiding the function call overhead.[src] In early iterations of C with Classes, every class would also have void call() and void return() (implicitly defined if not explicitly written) methods which would be called before and after (respectively) every function call.[src] define STACK_SIZE 128 include class Stack { char* min; char* top; char* max; /* Constructor, with default parameter */ void new(int size = STACK_SIZE) { top = min = new char[size]; max = min + size - 1; } /* Destructor */ void delete(void) { delete min; } public: void push(char c); char pop(void); }; /* Notice it is Stack.push(), not Stack::push() */ void Stack.push(char c) { if (max C with Classes did not have virtual functions or function and operator overloading; these were not added until C++ in 1984.[src] Templates did not appear until Cfront 3.0 in 1991, and namespaces not until 1993; exceptions were first conceived for C++ around 1990 but only implemented in 1992.[src] ==Library additions== Stroustrup wrote various library headers for C with Classes; the most notable of these were a task library ( ) for Simula-style concurrency, as well as a stream-based I/O library ( , which would later become the foundation for the header.[src] task was a class with a private constructor, for types to inherit from (and should not be confused for std::execution::task , added in C++26), used to represent an independent activity (a coroutine, or lightweight thread).[src] Inter-task communication was done through queue classes, with a producer task putting data into qhead and a consumer task pulling it out from qhead .[src] Classes timer and clock were part of a time framework used for Simula-style event-driven simulations.[src] ==See also== Cfront C++ ==References== ==External links== C++ History Collection – a collection of design documents for historical C with Classes and C++[src]
31 sentences · 31 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"C with Classes." encyclopegia.org, 2026, https://encyclopegia.org/wiki/c-with-classes. Accessed 27 November 2026.
Chicago
"C with Classes." encyclopegia.org. Accessed November 27, 2026. https://encyclopegia.org/wiki/c-with-classes.
APA
encyclopegia.org. (2026). C with Classes. Retrieved November 27, 2026, from https://encyclopegia.org/wiki/c-with-classes
Accessed November 27, 2026 · CC BY-SA 4.0 · citation page · JSON