Advice on Learning C++

Alright so I'm reading Accelerated C++ 2000, I'm only on page 144/453. I haven't read it in the past month because I mostly got impatient but somewhat lazy. (Been programming Lua) And when I was reading the book, I felt very strained. It would be a dream of mine to excel at C++. So I need some advice on how to go about this. Should I read a certain amount each day? Make it time based or chapter based? Any other tips are appreciated as well.
As with any language you don't really learn anything until you get hands on.

Reading books is a good way to prime yourself and to add on to existing knowledge, but to really gain any ground, you HAVE to write some programs.

So start writing. Write a few simple programs to test what you know. They try to do something you don't know how to do (forcing you to learn how to do it, thus increasing your knowledge a bit more), etc, etc.
I don't really know what I should write since most of the programs are too simple to be interesting, but in my book I do the exercises.
eNergizer, I have just started learning cpp also and the exercises are simple because the author is trying to introduce to you different features and functions of the language so you write correct code that is efficient and clean. You will notice that some exercises are simple and then have add-ons. Being impatient or "somewhat lazy" really is an attitude you will need to drop as this takes time and commitment... especially if you want to follow your dream of "excelling at C++"...

Is Accelerated C++ 2000 a good book though? I kind of find it hard to follow along sometimes that I end up yawning constantly. Especially how the exercises can be so confusing. For example:

5-1. Design and implement a program to produce a permuted index. A permuted index is one
in which each phrase is indexed by every word in the phrase. So, given the following input,
The quick brown fox
jumped over the fence
the output would be
The quick brown fox
jumped over the fence
The quick brown fox
jumped over the fence
jumped over the fence
The quick brown fox
jumped over the fence
The quick brown fox
A good algorithm is suggested in The AWK Programming Language by Aho, Kernighan, and
Weinberger (Addison-Wesley, 1988). That solution divides the problem into three steps:
Read each line of the input and generate a set of rotations of that line. Each rotation
puts the next word of the input in the first position and rotates the previous first word
1.
to the end of the phrase. So the output of this phase for the first line of our input would
be
The quick brown fox
quick brown fox The
brown fox The quick
fox The quick brown
Of course, it will be important to know where the original phrase ends and where the
rotated beginning begins.
2. Sort the rotations.
Unrotate and write the permuted index, which involves finding the separator, putting
the phrase back together, and writing it properly formatted.


Also, I have to look up in the dictionary loads of times just to understand what the author is trying to explain.
Last edited on
For a beginner I highly recommend How to Program C++ 6th or 7th edition, Dietel.
The end of chapter exercises are defiantely a good start but can sometimes be lacking in amount and difficulty. The one piece of advice I can give you which has been my biggest aid (apart from the obvious writing of programs) is to stay anactive member on this site. You will learn a lot from programmers like Disch ad Return 0 who are more advanced and have a broader knowledge of C++, and who can offer information that I can guarantee won't be in the text of a beginners book.

eNergizer wrote:
Should I read a certain amount each day? Make it time based or chapter based?

Chapter based isn't really a viable method as the latter chapters tend to be much more complex than the beginning chapters and will require more time. For example, templates and operator overlaoding compared to variable types and program structure.
I am a beginner and have been reading "C++ A Beginner's Guide" by Herbert Schildt

You can download it for free in PDF format here

http://msdn.microsoft.com/en-us/beginner/cc305129.aspx


It has been pretty good.
Topic archived. No new replies allowed.