Navigation



LearnCpp.com: Now with threaded comments!

Hola everyone!

As promised, I’ve changed the site over to use threaded comments. This means it is now possible to reply to specific posts! You should find this new system quite intuitive, and it will make it easier for me to respond to individual posts.

This functionality is based off of a WordPress plugin . . . → Read More: LearnCpp.com: Now with threaded comments!

8.14 — Anonymous variables and objects

In some cases, we need a variable only temporarily. For example, consider the following situation:

int Add(int nX, int nY) { int nSum = nX + nY; return nSum; } int main() { using namespace std; cout << Add(5, 3); return 0; }

In the Add() function, note that the nSum variable is really . . . → Read More: 8.14 — Anonymous variables and objects

Happy holidays to everyone!

I just wanted to take a moment and wish everybody a very happy holiday season!

In the 8 months this site has been in existence, we have had over 140,000 page views! I’d like to give special thanks to those of you who have taken the time to give feedback, catch typos, or helped . . . → Read More: Happy holidays to everyone!

11.1 — Introduction to inheritance

In the lesson on composition, you learned how to construct complex classes by combining simpler classes. Composition is perfect for building new objects that have a has-a relationship with their subobjects. However, composition (and aggregation) is just one of the two major ways that C++ lets you construct complex classes. The second way is . . . → Read More: 11.1 — Introduction to inheritance

0.7 — A few common C++ problems

In this section, we’ll address some of the common issues that new programmers seem to run across with fairly high probability. This is not meant to be a comprehensive list of compilation or execution problems, but rather a pragmatic list of solutions to very basic issues. If you have any suggestions for other issues . . . → Read More: 0.7 — A few common C++ problems