0.3 — Introduction to C/C++

Before C++, there was C

The C language was developed in 1972 by Dennis Ritchie at Bell Telephone laboratories, primarily as a systems programming language (a language to write operating systems with). Ritchie’s primary goals were to produce a minimalistic language that was easy to compile, allowed efficient access to memory, produced efficient code, and was self-contained (not reliant on other programs). For a high-level language, it was designed to give the programmer a lot of control, while still encouraging platform (hardware and operating system) independence (that is, the code didn’t have to be rewritten for each platform).

C ended up being so efficient and flexible that in 1973, Ritchie and Ken Thompson rewrote most of the Unix operating system using C. Many previous operating systems had been written in assembly. Unlike assembly, which produces programs that can only run on specific CPUs, C has excellent portability, allowing Unix to be easily recompiled on many different types of computers and speeding its adoption. C and Unix had their fortunes tied together, and C’s popularity was in part tied to the success of Unix as an operating system.

In 1978, Brian Kernighan and Dennis Ritchie published a book called “The C Programming Language”. This book, which was commonly known as K&R (after the authors’ last names), provided an informal specification for the language and became a de facto standard. When maximum portability was needed, programmers would stick to the recommendations in K&R, because most compilers at the time were implemented to K&R standards.

In 1983, the American National Standards Institute (ANSI) formed a committee to establish a formal standard for C. In 1989 (committees take forever to do anything), they finished, and released the C89 standard, more commonly known as ANSI C. In 1990 the International Organization for Standardization (ISO) adopted ANSI C (with a few minor modifications). This version of C became known as C90. Compilers eventually became ANSI C/C90 compliant, and programs desiring maximum portability were coded to this standard.

In 1999, the ANSI committee released a new version of C called C99. C99 adopted many features which had already made their way into compilers as extensions, or had been implemented in C++.


C++ (pronounced see plus plus) was developed by Bjarne Stroustrup at Bell Labs as an extension to C, starting in 1979. C++ adds many new features to the C language, and is perhaps best thought of as a superset of C, though this is not strictly true (as C99 introduced a few features that do not exist in C++). C++’s claim to fame results primarily from the fact that it is an object-oriented language. As for what an object is and how it differs from traditional programming methods, well, we’ll cover that in chapter 8 (Basic object-oriented programming).

C++ was standardized in 1998 by the ISO committee (this means the ISO committee ratified a document describing the C++ language, to help ensure all compilers adhered to the same set of standards). A minor update was released in 2003 (called C++03).

Three major updates to the C++ language (C++11, C++14, and C++17, ratified in 2011, 2014, and 2017 accordingly) have been made since then, each adding additional functionality. C++11 in particular added a huge number of new capabilities, and at this point is widely considered the new baseline. As of the time of writing, C++20 is in the works, promising to bring even more new capabilities. Future upgrades to the language are expected every three or so years.

Each new formal release of the language is called a language standard (or language specification). Standards are named after the year they are released in. For example, there is no C++15, because there was no new standard in 2015.

C and C++’s philosophy

The underlying design philosophy of C and C++ can be summed up as “trust the programmer” -- which is both wonderful and dangerous. C++ is designed to allow the programmer a high degree of freedom to do what they want. However, this also means the language often won’t stop you from doing things that don’t make sense, because it will assume you’re doing so for some reason it doesn’t understand. There are quite a few pitfalls that new programmers are likely to fall into if caught unaware. This is one of the primary reasons why knowing what you shouldn’t do in C/C++ is almost as important as knowing what you should do.

Q: What is C++ good at?

C++ excels in situations where high performance and precise control over memory and other resources is needed. Here are a few common types of applications that most likely would be written in C++:

  • Video games
  • Real-time systems (e.g. for transportation, manufacturing, etc…)
  • High-performance financial applications (e.g. high frequency trading)
  • Graphical applications and simulations
  • Productivity / office applications
  • Embedded software
  • Audio and video processing

Q: Do I need to know C before I do these tutorials?

Nope! It’s perfectly fine to start with C++, and we’ll teach you everything you need to know (including pitfalls to avoid) along the way.

Once you know C++, it should be pretty easy to learn standard C if you ever have the need. These days, C is mostly used for niche use cases: code that runs on embedded devices, when you need to interact with other languages that can only interface with C, etc… For most other cases, C++ is recommended.

0.4 -- Introduction to C++ development
0.2 -- Introduction to programming languages

239 comments to 0.3 — Introduction to C/C++

  • Zaw Oo

    I'm enjoying these courses ore than I enjoyed taking the CS courses at my college. Keep up the good work guys and lets all achieve our goals together . : )

  • I was very impressed to see this post, the steps to activate using then it's good to read the latest articles and blog posts on our page.

  • Brian

    Awesome tutorial.

  • mowi

  • I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people. Thanks for sharing the information keep updating, looking forward to more post.Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.

  • "Plenty of useful information here. I am sending it to a
    few friends ans additionally sharing in delicious.
    And certainly, thank you in your effort!"

  • Harry Pi

    Thank you for this tutorial !!!!!!

  • Awesome article ... Im enjoying this series.

  • Ernest Dinsdale

    Good Day. Thank you for the article. I enjoyed learning the history of C/C++. I would like to become a gamer coder.

  • ninja turtles

    Here we go!

  • Thank you for your article that is useful for me, and I will save the name of your blog, I will definitely return to read your new article.

  • Don

    i havent really learned programming yet but ill try

  • Ahmed Sersawy

    wooow very very good .........thanks

  • Christine Willis

    Very informative. The narrative and  the Q&A. Sincere thanks.

  • Mark A Bednar

    I Have no experience in programming at all so im going to try this and see if i can learn C++. Thank You for the site.

  • Shankhui

    Hello Alex and NASCAR
    A small suggestion if you guys don't mind,
    In the second paragraph under C++ term,

    [b]"C++ was standardized in 1998 by the ISO committee (this means the ISO committee ratified a document describing the C++ language, to help ensure all compilers adhered to the same set of standards). A minor update was released in 2003 (called C++03)"[/b]
    For better understanding about the first standard you guys could add :-
    [b]"C++ was standardized in 1998 by the ISO committee (called C++98).[/b]
    I don't know if the sentence is right but you can add C++98 as it makes confusion for beginners I.e they tend to take c++03 as the first standard.
    PS.Just checking if bb codes work here.

  • amr

    really thank u guys for this awesome blog

  • sami

    Hello Alex and other co-founder who I don't know your name:
    I wanted to thank you for sharing your valuable knowledge with us. I literally ENJOY studying through your blog. It is super clear, fluent, understandable and easy to follow. I have to say that I lose track of time while start reading this blog. This is amazing. That's how those who truly understand concepts could write in such way: like  professionals. You should write a book in C++.
    Thanks again for making us love this amazing language!

    • Alex

      True story: A major publisher that you've probably heard of reached out many years ago and asked if I'd write a book for them. I said no.

      Truth be told, I prefer the online format -- I can work on this site at my own pace, add new content as time permits, and it's great being able to interact with everyone. Paper books are old school. :)

  • Nowadays C++ learn is good option or not? most of user moving to python and say C++ is dying....
    however my teacher say learn programming not Languages, To what extent is this correct?

    • Parash Patel

      You're teacher is right. You should learn the concepts of programming like loops, conditional statements, variables, class and etc. If you get that down most programming languages will be easy to learn. Learning C++ first is a great choice. After that picking up Python should be a piece of cake.

    • nascardriver

      Python is no match for C++, they're fundamentally used for different things. If you need a reliable lower-level language, C++ is still the first choice. Rust is trying to compete, but its lack of a standard and modern script language features keep it back.
      As Parash Patel said, if you know C++, learning other languages is fairly easy. Though, C++ is a large language and can be challenging to learn. If you decide not to go with C++ half way through, try another language, it's probably easier.

    • leitning

      A good strategy is to pick one compiled language and one scripting language to be proficient in. In this regard python is a complement to C++, not an alternative.

  • Draven A Foster

    Can you change the buttons at the end of the section so you just have to click in the box instead of on the arrow or the text?

  • Vitaliy Sh.

    If appropriate, please, do add <b> tags to the dates inside that lesson. Just there is 13 dates, and navigating between them to lookup "who were when on top of whom" (historically) is a bit hard for an low-memory body.

Leave a Comment

Put all code inside code tags: [code]your code here[/code]