Navigation



0.1 — Introduction to these tutorials

Welcome to the C++ tutorials! The tutorials in this section are aimed primarily at beginning level programmers, including those who have little to no prior programming experience. Intermediate level programmers will probably also find plenty of tips and tricks that may be of use in improving their programming skills.

Each tutorial is broken down into sections, with each section containing a number of related subtopics. There is no suggested amount of time that you should spend with each section; progress through the material at a pace that is comfortable for you. Since the concepts from each section tend to build on those from previous sections, it is a good idea to ensure you generally understand each section before you move on.

The entire series of LearnCpp tutorials is provided free to you. We are hosted on a virtual private server to ensure these tutorials are consistently available any time you need them!

Before we get started, lets hit on a couple of important goals of these tutorials:

1) Cover programming topics as well as C++. Traditional textbooks do a pretty good job of teaching the basics of a given programming language, but they often do not cover relevant programming topics that are incidental to the language. For example, books will omit sections on programming style, common pitfalls, debugging, good/bad programming practices, and testing. Consequently, by the time you finish the book, you understand how to program in a language, but you have a ton of bad habits that will come back to bite you later! One of the goals of these tutorials is to make sure that all of these incidental topics are covered along the way, in the sections where it naturally makes sense to discuss them. When you finish, you will not only know how to program in C++, you will know how NOT to program in C++, which is arguably as important.

2) Provide a lot of examples. Most people learn as much or more from following the examples as they do from reading the text. It is often the case that the text will describe the theory of something, but the examples show how to apply it. This tutorial will endeavor to provide plenty of clear, concise examples to ensure that you are able to apply the concepts you’re learning. We will also avoid the twin evils: the magic hand wave (also known as …), where in the interest of space part of an example is omitted, and the unexplained new concept, where a new concept that is integral to the example is introduced without any mention of what it is or how it works. Both of these tend to lead to “getting stuck”, which makes moving on to the next concept rather difficult.

3) Provide practice programs. Unlike riding a bicycle, programming topics will fade from memory if not practiced. We strongly encourage you to not only read the examples, but compile and run them to see the result. If you are unsure how they work, use the debugger to walk through them line by line (we will cover how to do that in the appendix). Also, you can learn a lot by modifying the examples and recompiling them to see what happens. However, the best way to learn is to write your own program utilizing the concepts that you’ve learned. To encourage you to practice, the end of each section will contain some exercises that you can attempt to answer on your own, along with solutions. You can compare your solution against ours to see what we did differently, or, if you get stuck, how we solved the problem. Then you can go back and refocus on the areas you need more work on.

4) Most importantly: have fun. Programming can be a lot of fun, and if you’re not generally having fun, you’re not in the right mindset to be programming. Tired or unhappy programmers make mistakes, and debugging code tends to take much longer than writing it correctly in the first place! Often you can save yourself some time by going to bed, getting a good night’s sleep, and coming back to a problem in the morning. Tired or unhappy tutorial writers have many of the same issues. :)

Alright, let’s get on with it.

0.2 — Introduction to programming languages
Index
No previous lesson

129 comments to 0.1 — Introduction to these tutorials

  • Very nice tutorials. I am writing a blog on C/C++ tutorials. Hope that people will also like it.

  • nimadv

    Thank you so much Alex for all the tutorials here, very very helpful and constructive.

    But just one thing…
    you have been used Hungarian Notation almost everywhere and that’s quite painful for newbies like me to read your code, C++ is very hard to read and learn by itself, HN just make it more worst and I preferred to ignore it at all cost.
    Coming from Python background and I learn to code in a human-readable way, Also C++11 is all about making C++ fun again, easier to learn, use and teach. I believe Hungarian-Notation is exact opposite to this ultimate goal and I’m not the only one against this “obsolete” style of coding.

    This is only my personal opinion, thank you again and please keep it up Alex!
    Regards
    ND

  • Lakshmi

    Hi

    THis tutorial is really good.
    Is there any pdf version for this tutorial ?

  • http://msdn.microsoft.com/en-us/library/bb384843.aspx

    My main interest is in upgrading to a newer compiler so I can produce workable apps capable of running under Windows 7. The above link is provided by the MS Visual C++ Express 2010 user interface.

    When I saw terms like WinMain and WinProc, I knew I had finally found the glory hole motherload; just what I was looking for.

    When you first launch MIcrosoft Visual C++ 2010 Express UI, there’s a link for:

    –>’C++ Beginner’s Guide’

    When I click on that, a page is displayed in which Microsoft states their contract with the publisher has expired and the guide is no longer available. After 15secs, the page is automatically redirected to:

    –>’Visual C++ Developer Center’

    The link above takes you directly to the Visuall C++ Developer Center. At that point, under “Get Started with Visual C++” is a listing. Select:

    –>’Creating Windows Applications’

    Select the first entry under that category:

    –>’Creating Win32-Based Applications (C++)’

    This guide is very similar to what I was using for Borland’s software. Having a copy of Microsoft’s Visual C++ software isn’t required to view the web based guide via the above link.

  • tsdrifter

    Hey I just figured I should show my appreciation really quick – this is an incredibly helpful tutorial. I came from a limited background (I knew what if-then, loop, and variables were, but not too much more) and learning C++ with this tutorial is easy and effective. Best tutorial out there for C++ (possibly for any language :) ). Thanks!!!

  • XamaX

    Alex,

    You probably won’t read this but I just want you to know that you should not look at any haters that comment here, they’re probably not interested in programming enough to take some effort and go though the material. I’m sure that there are many more people that read all this and learned a lot but didn’t comment. Thank you very much for the effort you put in this site!

  • [...] with that sorted out, let’s begin! 0.1 — Introduction 0.2 — Intro to programming [...]

  • theintunoo

    I want to share in Facebook to my friends. Can I do Like this?

  • zubi

    just starting, i don’t know anything about c++

  • zubi

    how does this work?

  • I want to know the best site name to learn asp.net plz reply fast and reply on my mail also

  • coitucach

    khó h?c quá à?????

  • liang weigang

    Excelent tutorials!
    I want to translate to my mother language and to share it to more people.Can i do it and put it on my personal website?

  • SivaSankar

    Excellent tutorials
    THANKS TO LEARNCPP

  • I am taking C++ for Fall 2013 semester. Definitely gonna be helpful. Thanks.

You must be logged in to post a comment.