PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Best way to learn C++?

I have been wanting to learn C++ for awhile now, I have a Sams book and my friends say they arent the best. I'm wondering how you learned or what you reccomend if you want to learn C++
Start programming. Best way regardless of language. Grab some examples off the web to get some basic concepts in your head and start with a simple Hello World program, and keep building up little programs with more functionality.

If your completely new to programming then you may want to pick up a book to start with, but I don't have any specifically to recommend.

If you are just new to C++, then just jump in, come up with a reasonably simple program to write and do it.

Then again, it ultimately depends on what kind of learner you are. Some people absolutely need a textbook to get going, others do best when they just jump in and actually try to do something (I think most programmers fall in that category). Some people find a classroom lecture is required before they start to get it. Figure out which type you are and approach it from that way, but if you are "do it to learn it" type, then don't get hung up on looking for a good book or tutorials or even a boatload of examples. Just jump in and write something.
Do you know of any websites that have those examples on it? thanks for the help
Go to www.google.com

Put in:

c++ learning examples

or just plain:

c++ examples

...and have fun. The first page of results alone should keep you busy for a while.
By the way, I wouldn't recommend Practical C++ Programming (O'reilly) for a complete beginner; it is very hard to understand, and gets complex way too early. Try and get a book that has programming exercises in it. The best way to learn C/C++ is to apply the language.

I used Absolute Beginners guide to C as my first "official" book, and although it wasn't bad, it had many errors that threw me off at times.

Also, if something gets too hard, stop for a little while, and come back to it.

If you get stuck, come to this forum for help, I know it has helped me quite a bit!
Alex did you just jump into C++ or did you do like basic first?
I tried "Learn C++ in 10 minutes" and it wasn't so good, I didn't learn very much, but then I moved on to Absolute beginners guide to C where I learned a very basic yet efficient understanding of C. I then moved on to Practical C++ Programming.

From what I hear, Practical C programming is quite good. I found the C++ version to be a little tough for beginners (but I wasn't a complete beginner at the time).
I think this is a decent webpage for beginners:
http://www.juicystudio.com/tutorial/cpp/index.html
Make sure you understand concept of pointers and basically low level workings of CPU/memory.
You will never be able to design efficient and relatively bug free programs without knowing this stuff well.
I hear Bruce Eckel's "Thinking in C++" book is good. (At least I think he has one on C++.)

Accelerated C++ (by Koenig) is good. There are other books in that series (little red books by Addison-Wesley) and they are all good.
OK, C++ is the most powerful language, I use C++ myself when I develop my PPC-games.

But if you are new and want to be more productive from start, try C# (Ehh or maybe Java).
I would recommend GapiDraw and the .Net wrapper thats availible.

You will get almost the same performance but a much better language and api.

The only downside is that you have to install .Net compact framework on non Windows Mobile 2003 units.
Hi Robob

Are you wanting to learn c++ to write games or is your main aim to be proficient in Object Oriented programming C++ style? This is an important question cause if you mainly want to write games then you can study the examples available with PocketFrog or GapiDraw & all the games related material on www.gamedev.net and get by fine however if you want to do C++ properly you have to understand all the OO stuff like classes, inheritance, overloading etc which all seem pretty scary but end up being logical once you figure them out. No matter what you will have to learn some of the OO stuff to survive.

As a long time programmer with lots of too expensive books on my shelf I find the best book I bought to be 'Shaum's easy outlines, Programming with C++' which is a cheap book designed to help students get through exams. Nothing wrong with Sams books though anything which claims to teach a complex subject in just a few lessons is dreaming.

One last work (or two) BE PATIENT :) C++ takes a while to learn