Jump to content
xisto Community
rpgsearcherz

Best Books For Learning C++

Recommended Posts

Hey guys, I'm wondering what books everyone here would recommend for learning C++ (I plan to learn the language and then move into DirectX API for games later). As for the size and/or cost of the book, it's not relevant.Right now I'm reading Principles and Practice using C++ by Bjarne Stroustrup (who is, as far as I know, the creator of C++).It seems to be a pretty good book so far but I'm wondering where I should go from there (to go a little more in-depth.. I'm guessing intermediate level is where I'd want to go to).Thanks guys!

Share this post


Link to post
Share on other sites

I would highly recommend C++ Primer Plus (not C Primer Plus) 5th Edition by Stephen Prata for around 30-40 USD. The book consists of around 1200 pages. It assumes that you know nothing about programming. By the time you finish reading the book, you are an accomplished C++ programmer (taken that you completed all of the programming exercises at the end of the chapters to demonstrate that you understand the concepts). You say that you are reading Principles and Practice using C++ by Bjarne Stroustrup so I guess you can sort of skim through the C++ Primer Plus book looking for new concepts. C++ Primer Plus teaches you Object-Oriented Programming more advanced features of the C++ language.If you want to learn how to program games, I would recommend reading C++ Primer Plus 5th Edition and continuing your education with Windows Programming and DirectX 9 or 10 depending on your OS at http://www.directxtutorial.com/

Share this post


Link to post
Share on other sites

i recommend you "C++ for dummies", and don't be offended please i don't mean you are a dummy or something like that, but i do like these series of books for dummies i use it myself if i want to learn anything from scratch. because the author always assume you don't know anything about the subject and start explaining everything from scratch even the small details. if you check it you will understand what i am talking about.

it is about 432 pages, the last edition was in may 2009,even its price is reasonable about i think.here is the link of the book, check it if you want.

http://www.dummies.com/store/product/C-For-Dummies-6th-Edition.productCd-0470317264,navId-322467,descCd-description.html

and this is the table of contents.

Part I: Introduction to C++ Programming.
Chapter 1: Writing Your First C++ Program.

Chapter 2: Declaring Variables Constantly.

Chapter 3: Performing Mathematical Operations.

Chapter 4: Performing Logical Operations.

Chapter 5: Controlling Program Flow.

Part II: Becoming a Functional C++ Programmer.

Chapter 6: Creating Function.

Chapter 7: Storing Sequences in Arrays.

Chapter 8: Taking a First Look at C++ Pointers.

Chapter 9: Taking a Second Look at C++ Pointers.

Chapter 10: The C++ Preprocessor.

Part III: Introduction to Classes.

Chapter 11: Examining Object-Oriented Programming.

Chapter 12: Adding Class to C++.

Chapter 13: Point and Stare at Objects.

Chapter 14: Protecting Members: Do Not Disturb.

Chapter 15: Why Do You Build Me Up, Just to Tear Me Down Baby?

Chapter 16: Making Constructive Arguments.

Chapter 17: Copying the Copy Copy Copy Constructor.

Chapter 18: Static Members: Can Fabric Softener Help?

Part IV: Inheritance.

Chapter 19: Inheriting a Class.

Chapter 20: Examining Virtual Member Functions: Are They for Real?

Chapter 21: Factoring Classes.

Part V: Optional Features.

Chapter 22: A New Assignment Operator, Should You Decide to Accept It.

Chapter 23: Using Stream I/O.

Chapter 24: Handling Errors — Exceptions.

Chapter 25: Inheriting Multiple Inheritance.

Chapter 26: Tempting C++ Templates.

Chapter 27: Standardizing on the Standard Template Library.

Part VI: The Part of Tens.

Chapter 28: Ten Ways to Avoid Adding Bugs to Your Program.

Chapter 29: Ten Major Recent Additions to C++.


Share this post


Link to post
Share on other sites

I found "Absolute C++" book handy for practical approach. In market you'll find tons of C++ books with theoretical approach but hardly there are any with good practical examples. This is the reason why i search for most of the books with practical approach. Robert lafore has few good books in his belt. There is one famous and worthy book he has written "Object oriented programming", you can check that book cause robert has written it in manner which makes it easy to understand. By the way you can check this hub aboutlist of C++ books sorted as per level of difficulty.

If i've to suggest someone C++ books, my suggestion will be :
1. Absolute C++
2. Object oriented programming -Robert lafore
3. C++ primer

Many people on stackoverflow and other forums suggest bruce eckel but i digress. I think for newbies and intermediate people it's not the book. You'll find yourself into more conflicts if you try bruce eckel's books. Avoid "In easy steps" and "For dummies" books as they're band-aid and cut-paste approach books. Herbt schildt is also overrated and rarely you'll find content in the books of herbt schildt so i suggest you should avoid his books.

Share this post


Link to post
Share on other sites

I've always liked "C++ The Complete Reference". The "complete reference" series has a great track record in bringing out good books and this one has been superb as well. It starts well with the basics and can go at a blistering speed if you don't watch out. So if you can keep up with the pace then this one is a really good choice. I think there's a preview available at Google Books as well although I'm not sure of that entirely.

Share this post


Link to post
Share on other sites

I would highly recommend C++ Primer Plus (not C Primer Plus) 5th Edition by Stephen Prata for around 30-40 USD. The book consists of around 1200 pages. It assumes that you know nothing about programming. By the time you finish reading the book, you are an accomplished C++ programmer (taken that you completed all of the programming exercises at the end of the chapters to demonstrate that you understand the concepts). You say that you are reading Principles and Practice using C++ by Bjarne Stroustrup so I guess you can sort of skim through the C++ Primer Plus book looking for new concepts. C++ Primer Plus teaches you Object-Oriented Programming more advanced features of the C++ language.

 

If you want to learn how to program games, I would recommend reading C++ Primer Plus 5th Edition and continuing your education with Windows Programming and DirectX 9 or 10 depending on your OS at http://www.directxtutorial.com/

 

Would the primer books not be more geared towards people who already fully understand the material? I thought it would skip a lot of steps and just go over random basics to help reinforce a few important things.

 

I've actually ran into a few books like that before and all they did is leave me more confused than before.

 

 

i recommend you "C++ for dummies", and don't be offended please i don't mean you are a dummy or something like that, but i do like these series of books for dummies i use it myself if i want to learn anything from scratch. because the author always assume you don't know anything about the subject and start explaining everything from scratch even the small details. if you check it you will understand what i am talking about.

 

it is about 432 pages, the last edition was in may 2009,even its price is reasonable about i think.here is the link of the book, check it if you want.

 

http://www.dummies.com/store/product/C-For-Dummies-6th-Edition.productCd-0470317264,navId-322467,descCd-description.html

 

and this is the table of contents.

 

These are good books for basics; I've started the C++ one already. The issue is they don't spend enough time on real-world programming. It's more or less "here's how to to x," "now here's how to do xx." They don't go through, for example, "For a banking application, you would need to use this thought process and work towards..." or anything like that.

 

Real world experience counts for more than anything else.

 

I found "Absolute C++" book handy for practical approach. In market you'll find tons of C++ books with theoretical approach but hardly there are any with good practical examples. This is the reason why i search for most of the books with practical approach. Robert lafore has few good books in his belt. There is one famous and worthy book he has written "Object oriented programming", you can check that book cause robert has written it in manner which makes it easy to understand. By the way you can check this hub aboutlist of C++ books sorted as per level of difficulty.

 

If i've to suggest someone C++ books, my suggestion will be :

1. Absolute C++

2. Object oriented programming -Robert lafore

3. C++ primer

 

Many people on stackoverflow and other forums suggest bruce eckel but i digress. I think for newbies and intermediate people it's not the book. You'll find yourself into more conflicts if you try bruce eckel's books. Avoid "In easy steps" and "For dummies" books as they're band-aid and cut-paste approach books. Herbt schildt is also overrated and rarely you'll find content in the books of herbt schildt so i suggest you should avoid his books.

 

This one I've never heard of. I'll definitely check it out and see where it takes me.

 

I've always liked "C++ The Complete Reference". The "complete reference" series has a great track record in bringing out good books and this one has been superb as well. It starts well with the basics and can go at a blistering speed if you don't watch out. So if you can keep up with the pace then this one is a really good choice. I think there's a preview available at Google Books as well although I'm not sure of that entirely.

 

Do you mean C++ or Visual C++? I have a Visual C++ The Complete Reference book, but it got me nowhere. It spent more time on drawing boxes using C++ than anything -- I'd much rather just make a cube and load it in via DirectX, lol.

 

 

 

Thanks for the information though guys. I'm not putting down your ideas or anything, just explaining the issues I've had with the different books listed (if any).

Share this post


Link to post
Share on other sites

Do you mean C++ or Visual C++? I have a Visual C++ The Complete Reference book, but it got me nowhere. It spent more time on drawing boxes using C++ than anything -- I'd much rather just make a cube and load it in via DirectX, lol.


I definitely meant the C++ book, not Visual C++ And there's much less of box-drawing in this one ;) You can take a look at the preview here. I think you might like it a bit.


Share this post


Link to post
Share on other sites

Hi!I say, when you've read one book, you've got to move on to working with some source code. Sure, reading a second book might give you the concepts that you may have missed with book one, but you do not benefit as much as you could have with the same amount of time.Visual C++ books are different from plan old C++ books. Visual C++ books aim at targeting their readers into Windows programmers. You would find yourself working with the message loop, dealing with handles, making Win32 API calls, and stuff of the sort - instead, a regular C++ book tells you about classes, inheritance, the standard template library, operator precedence, and pointers.If you do feel like you've hit a glass ceiling when reading books, you ought to take the leap into open-source code. There are lots of open source projects out there and there's tons of code for you to sift through. In the process, you might even be able to resolve a couple of tickets and lend the open-source community a helping hand. It always starts with the first step and then, before you know it, you're a full-fledged open-source advocate and developer. The Linux source code is one place where you can look up C code. Notepad++ is a Visual C++ based text editor.

Share this post


Link to post
Share on other sites

Hi!
I say, when you've read one book, you've got to move on to working with some source code. Sure, reading a second book might give you the concepts that you may have missed with book one, but you do not benefit as much as you could have with the same amount of time.

Visual C++ books are different from plan old C++ books. Visual C++ books aim at targeting their readers into Windows programmers. You would find yourself working with the message loop, dealing with handles, making Win32 API calls, and stuff of the sort - instead, a regular C++ book tells you about classes, inheritance, the standard template library, operator precedence, and pointers.

If you do feel like you've hit a glass ceiling when reading books, you ought to take the leap into open-source code. There are lots of open source projects out there and there's tons of code for you to sift through. In the process, you might even be able to resolve a couple of tickets and lend the open-source community a helping hand. It always starts with the first step and then, before you know it, you're a full-fledged open-source advocate and developer. The Linux source code is one place where you can look up C code. Notepad++ is a Visual C++ based text editor.


Thanks for that information. I'll definitely take it into consideration. Never really thought of using open source as a way to learn -- I was planning to move on into it once I felt like I had a solid understanding though.

I do have a compiler already (I'm a student so I get Visual Studio 2010 Professional for free).

You brought up the C++ vs Visual C++ thing and I'm a little lost on it. Wouldn't all books be more geared towards Windows programming by default? I've heard most things will work cross-platform (such as both Windows and Linux) but there are a lot of commands that won't (for example, system("pause"); won't work on Linux).

It seems most games and things like that are made by Visual C++ these days rather than just normal C++, so would you still suggest learning C++ before moving up?

There's just sooo much knowledge and soo much to learn still, it's a little overwhelming. It's kind of hard to really wrap your mind around the vast amount of stuff there is and figure out your direction.

Share this post


Link to post
Share on other sites

Would the primer books not be more geared towards people who already fully understand the material? I thought it would skip a lot of steps and just go over random basics to help reinforce a few important things.
I've actually ran into a few books like that before and all they did is leave me more confused than before.


Not at all. I started reading the book with absolutely no programming experience whatsoever. I had no idea what a compiler was, source code, etc. As long as you don't tend to skim books like I do sometimes (accidentally), you should have no problem picking up the concepts. I recommend that you should manually enter each and every one of the examples into your compiler and compile it yourself. After that, you should try changing some lines and see what it does.

You brought up the C++ vs Visual C++ thing and I'm a little lost on it. Wouldn't all books be more geared towards Windows programming by default? I've heard most things will work cross-platform (such as both Windows and Linux) but there are a lot of commands that won't (for example, system("pause"); won't work on Linux).


C++ and Visual C++ is no different from each other. Visual C++ is referring to the Microsoft Visual C++ Compiler. Books shouldn't be all geared towards Windows programming because it would be harder to teach C++ like that. Instead, the books teach you concepts through console programs (the little programs that run under the command prompt). Windows programs are large and complex by nature (few hundred lines of code) so it would be difficult to teach C++ with 80% of the book containing code. After mastering all the basics of C++ through console programming, you can move on to Win32 (Windows) programming which you could easily adapt to by putting it all together.

Some code is cross-platform. If your code can be compiled on different operating systems and machines without error, your code is considered "portable". You may want to put some research into which headers and functions are portable and which aren't. As for system("pause"); or system("ANYTHING"), you should avoid this line because it isn't portable and it sometimes triggers the antivirus. It is also a heavy function. What it does is halt the program for a bit, go to the operating system, do all this stuff, exit OS, and return to program. I would assume that you use this line to keep the console window open. You should use cin.get(); at the end of your code (once or twice depending how the compiler you are using compiles code). All this does is wait for you to press the RETURN key.

I agree that this is a lot of knowledge but if you can use it in your program, it can be really fun. Also, the reason a lot of games are programmed and compiled in Visual C++ is because the compiler is amazing. There are many options on the compilation, linking, etc.

I forgot to mention another book that is free for download from the MSDN website called C++ Beginner's Guide by Herbert Schildt. He is a pretty well known programmer author who writes books on Java, C#, and other languages. I thought that the book was a much less intimidating book to read. It is an ebook and can be found here: https://www.visualstudio.com/vs/visual-studio-express/

I wish you luck in your programming. Maybe you'll come up with something promising in the future :P

Share this post


Link to post
Share on other sites

Not at all. I started reading the book with absolutely no programming experience whatsoever. I had no idea what a compiler was, source code, etc. As long as you don't tend to skim books like I do sometimes (accidentally), you should have no problem picking up the concepts. I recommend that you should manually enter each and every one of the examples into your compiler and compile it yourself. After that, you should try changing some lines and see what it does.

 

 

 

C++ and Visual C++ is no different from each other. Visual C++ is referring to the Microsoft Visual C++ Compiler. Books shouldn't be all geared towards Windows programming because it would be harder to teach C++ like that. Instead, the books teach you concepts through console programs (the little programs that run under the command prompt). Windows programs are large and complex by nature (few hundred lines of code) so it would be difficult to teach C++ with 80% of the book containing code. After mastering all the basics of C++ through console programming, you can move on to Win32 (Windows) programming which you could easily adapt to by putting it all together.

 

Some code is cross-platform. If your code can be compiled on different operating systems and machines without error, your code is considered "portable". You may want to put some research into which headers and functions are portable and which aren't. As for system("pause"); or system("ANYTHING"), you should avoid this line because it isn't portable and it sometimes triggers the antivirus. It is also a heavy function. What it does is halt the program for a bit, go to the operating system, do all this stuff, exit OS, and return to program. I would assume that you use this line to keep the console window open. You should use cin.get(); at the end of your code (once or twice depending how the compiler you are using compiles code). All this does is wait for you to press the RETURN key.

 

I agree that this is a lot of knowledge but if you can use it in your program, it can be really fun. Also, the reason a lot of games are programmed and compiled in Visual C++ is because the compiler is amazing. There are many options on the compilation, linking, etc.

 

I forgot to mention another book that is free for download from the MSDN website called C++ Beginner's Guide by Herbert Schildt. He is a pretty well known programmer author who writes books on Java, C#, and other languages. I thought that the book was a much less intimidating book to read. It is an ebook and can be found here: https://www.visualstudio.com/vs/visual-studio-express/

 

I wish you luck in your programming. Maybe you'll come up with something promising in the future :P

 

Wow, tons of useful information in that post. Thanks a lot for clearing up a lot of questions.

 

I never understood the system("pause") thing but yes, you're right about the use (to keep the window open). I didn't know it did anything else -- I always guessed that's *all* it did is keep it from closing.

 

Thanks again for the information though; it really is much appreciated.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.