# Looking for C++ Advice and Books

This topic is 4171 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I think I can help you a bit. I use only one book for leaning C++ and none other. It's called "C++ How to Program" by Deitel (Cost me over $90 for the 4th edition). It has everything from hello wold to data stuctures, and exception handling, etc... and concepts are explained very well in there. Dont get me wrong though, it's not perfect, but its very well done. There is also an optional Case Study in there, which is developed throughout the book. You wont start to actually programming it until you get to classes. Before then, you develope it. Yes its a big project(I havent gottan to it yet:D). I would suggest you do it. And of course there are excersises there. To the short answer excersises there, the answers are included, but the ones where you have to write a complete code to, you dont have answers. You may think this sucks, and it does, but this way, you are not tempted to look at it. You wreck your brain and actually learn something. The good news is that there is an answer key to the Case Study which you may reffer to after you work so hard that your brain doesnt work anymore. P.S. Since you are into C++, you might also want to look into C. Check out "The C Programming Language" by Brian W. Kernighan and Dennis M.Ritchie, the creators of C. Hope this helps. #### Share this post ##### Link to post ##### Share on other sites I used C++ Primer Plus. It's got pretty much everything you need for C++ basics. #### Share this post ##### Link to post ##### Share on other sites Quote:  Original post by DeepPurple25I think I can help you a bit. I use only one book for leaning C++ and none other. It's called "C++ How to Program" by Deitel (Cost me over$90 for the 4th edition). It has everything from hello wold to data stuctures, and exception handling, etc... and concepts are explained very well in there. Dont get me wrong though, it's not perfect, but its very well done. There is also an optional Case Study in there, which is developed throughout the book. You wont start to actually programming it until you get to classes. Before then, you develope it. Yes its a big project(I havent gottan to it yet:D). I would suggest you do it. And of course there are excersises there. To the short answer excersises there, the answers are included, but the ones where you have to write a complete code to, you dont have answers. You may think this sucks, and it does, but this way, you are not tempted to look at it. You wreck your brain and actually learn something. The good news is that there is an answer key to the Case Study which you may reffer to after you work so hard that your brain doesnt work anymore.P.S. Since you are into C++, you might also want to look into C. Check out "The C Programming Language" by Brian W. Kernighan and Dennis M.Ritchie, the creators of C.Hope this helps.

Thank you very much! Though, I question how much of that would be in-depth explanation, or just beginner introduction? Can you tell me more about the depth and style of the text?

Also, could anyone more experienced give more reccomendations or advice? I take it that you are still learning C++, and no offense, but I would still like to get a view from someone who's been programming for a long time...

##### Share on other sites
None taken. The explanations are pretty detailed, you are explained a consept, then gicen an example code pretaining to that concept, which then, is explained to you (pretty much line by line). This book was recommended to me by my uncle who is a C++ veteran :D. Anyhow, go check out their website here:

http://www.deitel.com/books/cppHTP4/cppHTP4_tob.html

for a tour of the book. You can also download some code examples from their site.

##### Share on other sites
Quote:
 Original post by MelpomeneThank you very much! Though, I question how much of that would be in-depth explanation, or just beginner introduction? Can you tell me more about the depth and style of the text?Also, could anyone more experienced give more reccomendations or advice? I take it that you are still learning C++, and no offense, but I would still like to get a view from someone who's been programming for a long time...

Well, im an old fart, does that count? I've been programming professionally ( aka, for money ) for a little over a decade. That said, I rarely if ever use C++ anymore so you might want to keep that in mind! ;)

C++ in a nutshell is a great book at explaining C++ in terms mortals can understand. After that book, pick up C++ Programming by Bjarne Stroustrup (sp?), he is the guy that created C++ and a decent writer to boot. There is a bargain basement book called something like C++ Template Design and Structure, or something to that effect. It does a great job of explaining the hows and whys of templates.

Template programming is one of the most powerful features of C++, but also one of the most misused, abused and confusing parts aswell. People will tell you memory management is the hardest thing in C++ ( the use of pointers, memory alloc and deallocation ), I say BAH to that. Templates are! I could explain to a newer programmer how to deal with memory in a safe and efficent manner about 5 times easier then I could explain how the BOOST libraries work or the gist of meta programming.

Follow the books I advised in the order I advised them and you should have a pretty good foundation. My biggest piece of advice is be project oriented, learning something, but not using it, is a difficult way to learn. Start with small projects that use the skills you learned. It goes a long way towards understanding what you are doing and is good at keeping you motivated. Make each project marginally more complicated then the last. But watch out for one huge gotcha. When you learn something new ( like say templates ) the old expression "When you have a hammer, everything starts to look like a nail". Be careful not to do things "just because you can".

My closing piece of advice is, I rarely use C++ anymore and their are good reasons for that. I am not going to get into them and I am not condemning C++ as a language, but when it comes to programming... if what you are doing in C++ doesnt feel "right", it might be time to pick up another language skill. For example, you could code web pages in C++. It would be about as fun as writing all your emails backwards though.

##### Share on other sites
Quote:
Original post by Serapth
Quote:
 Original post by MelpomeneThank you very much! Though, I question how much of that would be in-depth explanation, or just beginner introduction? Can you tell me more about the depth and style of the text?Also, could anyone more experienced give more reccomendations or advice? I take it that you are still learning C++, and no offense, but I would still like to get a view from someone who's been programming for a long time...

Well, im an old fart, does that count? I've been programming professionally ( aka, for money ) for a little over a decade. That said, I rarely if ever use C++ anymore so you might want to keep that in mind! ;)

C++ in a nutshell is a great book at explaining C++ in terms mortals can understand. After that book, pick up C++ Programming by Bjarne Stroustrup (sp?), he is the guy that created C++ and a decent writer to boot. There is a bargain basement book called something like C++ Template Design and Structure, or something to that effect. It does a great job of explaining the hows and whys of templates.

Template programming is one of the most powerful features of C++, but also one of the most misused, abused and confusing parts aswell. People will tell you memory management is the hardest thing in C++ ( the use of pointers, memory alloc and deallocation ), I say BAH to that. Templates are! I could explain to a newer programmer how to deal with memory in a safe and efficent manner about 5 times easier then I could explain how the BOOST libraries work or the gist of meta programming.

Follow the books I advised in the order I advised them and you should have a pretty good foundation. My biggest piece of advice is be project oriented, learning something, but not using it, is a difficult way to learn. Start with small projects that use the skills you learned. It goes a long way towards understanding what you are doing and is good at keeping you motivated. Make each project marginally more complicated then the last. But watch out for one huge gotcha. When you learn something new ( like say templates ) the old expression "When you have a hammer, everything starts to look like a nail". Be careful not to do things "just because you can".

My closing piece of advice is, I rarely use C++ anymore and their are good reasons for that. I am not going to get into them and I am not condemning C++ as a language, but when it comes to programming... if what you are doing in C++ doesnt feel "right", it might be time to pick up another language skill. For example, you could code web pages in C++. It would be about as fun as writing all your emails backwards though.

Ah, many thanks! If you could answer something else though:
If I took the time to learn how to use low level C, assembly, and VGA programming, and read through the book by Micheal Abrash entitiled "The Graphics Programming Black Book", which teaches low level graphics programming and how to make basic 3d engines, would it be worth the time in learning? Or should I spend that time make inventive action, arcade and puzzle games and practicing my C++?

The book is freely available at : http://www.byte.com/abrash/ .

Also, could you suggest a few cool projects for programming that aren't run of the mill aracade games? Maybe a game with something experimental like worms/Scorched Earth with dissapearing terrain, or some cool project like a compiler or OS? Well, maybe not as hard as a compiler, but still, after a while pac man gets boring.

Puzzle games would be easy and fun too, hmm. Do you know of any addictive classic puzzles that I could modify to make a fun game?

##### Share on other sites
Hey Melpomemne. Try to create a simple console application which finds the nth prime number for the user. It sounds like you've gotten the graphics side OK. This should really test (and hopefully improve) your maths, debugging and problem sovling ;)

Hint: you'll need to use the mod opperator.

##### Share on other sites
Quote:
 Original post by MelpomeneAh, many thanks! If you could answer something else though:If I took the time to learn how to use low level C, assembly, and VGA programming, and read through the book by Micheal Abrash entitiled "The Graphics Programming Black Book", which teaches low level graphics programming and how to make basic 3d engines, would it be worth the time in learning? Or should I spend that time make inventive action, arcade and puzzle games and practicing my C++?The book is freely available at : http://www.byte.com/abrash/ .Also, could you suggest a few cool projects for programming that aren't run of the mill aracade games? Maybe a game with something experimental like worms/Scorched Earth with dissapearing terrain, or some cool project like a compiler or OS? Well, maybe not as hard as a compiler, but still, after a while pac man gets boring.Puzzle games would be easy and fun too, hmm. Do you know of any addictive classic puzzles that I could modify to make a fun game?

Thats an easy answer. No. That book would have a horrible return on investment. I own it, atleast in its first iteration. At the time it was published ( in the DOS days ) you could almost consider it a bible. The man is brilliant and the book is very good. Its just that what it teaches just isnt relevant anymore. DirectX, OpenGL and HLSL all abstract away any concept of dealing directly with the hardware.

Heres a hint, if you ever think to yourself... Hmmm... maybe I should do this in assembly to increase the speed. Step back, you made a mistake somewhere. Now, down the road, by all means, take the time to read that book. It will go a long ways towards helping you understand some of the underlying concepts and math behind 3D programming. Right now though, it would be a horrible waste of your time.

As to cool projects, there is a game I have in mind to write, but cant because I am working on a book project at the moment. You would need to have a pretty good idea of 3d math to pull it off though, but other then that, its simple as simple gets.

You ever play one of those games ( like... made of wood or plastic games ), where you tilt the game around to make a ball roll down a hole to win? Thats just begging to be made into a simple arcade still game. You would just need four analog controls... tilt board left, forward, right and down. Then, based on angles and the physics behind it, you try to steer a ball through a maze.

Then, as levels change, you can increase the difficult by having more complex levels. For example, you could have a multi teired level, a level where gravity is lighter, or heavier. A level with magnets that push or pull your ball... whatever. Basically, its like Marble Blast, but instead of controlling the marble, you control the world around the marble.

Oddly, I think it would be strangely addictive and relatively easy to do. But get your basic programming down first. Do something pongish, then pongish with physics, then 3d pong with physics. At that point, you know everything you need to make the game I described. Oh, and if you are a C++ programmer ( or C#, I think there are bindings ) check out ODE, it would make the job alot easier.

Editted because me no spelz too gud

##### Share on other sites
Quote:
 Original post by CzarKirkHey Melpomemne. Try to create a simple console application which finds the nth prime number for the user. It sounds like you've gotten the graphics side OK. This should really test (and hopefully improve) your maths, debugging and problem sovling ;)Hint: you'll need to use the mod opperator.

He's already done pong and an isometric game. Going back to console programming would be painfully boring, but your suggestion is a good one for people working on algorithm skills.

##### Share on other sites
You may want to consider reading Thinking in C++ Vol1 and 2. Both a legally free ebooks and explain the C++ language well.

You may also want to look at the latter part of this small article I wrote. There may be some links of use to you: Where to Start C++ Programming

##### Share on other sites
Quote:
Original post by Serapth
Quote:
 Original post by CzarKirkHey Melpomemne. Try to create a simple console application which finds the nth prime number for the user. It sounds like you've gotten the graphics side OK. This should really test (and hopefully improve) your maths, debugging and problem sovling ;)Hint: you'll need to use the mod opperator.

He's already done pong and an isometric game. Going back to console programming would be painfully boring, but your suggestion is a good one for people working on algorithm skills.

If I were to pick up a book on the Standard Library (Which is a superset of the STL, right?), would that in addition with the primer be enough to start chugging away with the game programming? Would I benifit from learning stuff from the boost library?

Thanks for the suggestion about math, but I'm set there. And I've got double digit scores on practice AIMEs to prove it :).

How easy it is to do sound realated things? I know, for example, that making a basic software mp3 player would be kinda easy, just basic file I/O, but how hard would making a software chromatic tuner or midi sequencer be?

And what would be a good book to learn IOI style programming from? I assume a basic algorithms and data structures book would suffice?

I've been looking for pain free (or as pain free as it can get) assembly introductions. (not for practical stuff, but for general knowledge. I still can't stand not knowing how cout pops up that console window and writes stuff to it :(. I'm such a knowledge freak) Would "Art of Assembly" be a good book?

Also, if I were to learn Perl or more Ruby, it seems that I have to go through a very messy process to bind functions and objects and other generally unpleast procedures if I want to combine C++ with something else. I've read about scripting a little and I think a good project would be offloading the AI in whatever game I make into a little script. Is there anything I can do to ease the process of making the languages work together?

Edited in to avoid double post:

I've been looking at demo and effects programming, and it's kind of cool. Water, fire, plasma, etc. How would I get something like this to run as a screen saver?

About physics: Should I read a programmer's introduction (aka "Physics for Game Programmers") or a real textbook (aka Tipler). I'm afraid I haven't gone to college or taken AP physics yet, so my knowledge in that area is just basic calculus and whatever I gleaned from reading the first few chapters of Tipler..

##### Share on other sites
Quote:
 Original post by MelpomeneIf I were to pick up a book on the Standard Library (Which is a superset of the STL, right?), would that in addition with the primer be enough to start chugging away with the game programming? Would I benifit from learning stuff from the boost library?Thanks for the suggestion about math, but I'm set there. And I've got double digit scores on practice AIMEs to prove it :). How easy it is to do sound realated things? I know, for example, that making a basic software mp3 player would be kinda easy, just basic file I/O, but how hard would making a software chromatic tuner or midi sequencer be?And what would be a good book to learn IOI style programming from? I assume a basic algorithms and data structures book would suffice?I've been looking for pain free (or as pain free as it can get) assembly introductions. (not for practical stuff, but for general knowledge. I still can't stand not knowing how cout pops up that console window and writes stuff to it :(. I'm such a knowledge freak) Would "Art of Assembly" be a good book?Also, if I were to learn Perl or more Ruby, it seems that I have to go through a very messy process to bind functions and objects and other generally unpleast procedures if I want to combine C++ with something else. I've read about scripting a little and I think a good project would be offloading the AI in whatever game I make into a little script. Is there anything I can do to ease the process of making the languages work together?Edited in to avoid double post:I've been looking at demo and effects programming, and it's kind of cool. Water, fire, plasma, etc. How would I get something like this to run as a screen saver?About physics: Should I read a programmer's introduction (aka "Physics for Game Programmers") or a real textbook (aka Tipler). I'm afraid I haven't gone to college or taken AP physics yet, so my knowledge in that area is just basic calculus and whatever I gleaned from reading the first few chapters of Tipler..

Too many questions grasshopper! :)

Take things one day at a time. Take the knowledge you have or havent learned today and apply it to a project, if you hit a wall, take a different approach. Dont try to learn too many things at one time.

As to your questions. First off, Boost is a powerful library, but a confusing one. Leave it alone until you need it is my opinion. Eventually you will run into a problem and boost will be the perfect answer, until then, dont bother. Learning STl on the other hand is a worthy task. As to learning from Boost, you wont. Until you know C++ like a zen master, its arcane at best. It truly is a complicated beast ( and a bit of a hack to boot ).

Your question regarding sound ends with an astonding depends. If you use a high level library, sound isnt that hard. Most sound algorithms basically look at sound as a series of value ranges that compose a sound wave. At its core, its a pretty easy subject. That said, if you arent using an API like DirectSound, well... personally I wouldnt want to do it.

IOI? Sorry, my acronym skills aint what they used to be. Microsoft will do that to you.

As to this whole assembly thing, drop it, honestly. Some time down the road it may be an intersting thing to learn, but for now its pretty much a useless skill. You would better spend your time learning C++ better, or failing that, a different high level language. Assembly really isnt that valuable a skill, and once you decide to learn it, its really rather trivial. Just forget it for now would be my advice.

As to binding in a script language. Python, Lua, and any .NET language make it fairly easy to do. For example, binding in the Python runtime takes perhaps a half dozen lines of code to be up and running.

Now... to the rest of your questions( you edited in )... stop asking so damned many questions!!! ;) First off, there are a ton of screen saver libraries that get you up and running with almost zero additional code. To your physics questions, that depends on you. Frankly, not to many people actually use textbook physics these days, they depend on 3rd party libraries. And, to be honest, thats probrably the best approach. So, if you are looking into what kind of book to buy, pick one up on physics as related to game programming. If sometime down the road you end up writing a physics engine instead of using someone elses, then its time to pick up a more "pure" book on the subject.