#2 Members - Reputation: 680
Posted 02 July 2012 - 04:36 PM
You should try making some programs, if the book has exercises do them. Theirs also tutorials online for C++. http://www.learncpp.com/, http://www.cplusplus.com/doc/tutorial/.I got a C++ book on the front of me. Are there any methods of learning C++ execpt reading it off...? Share your learning experience...!
Theirs really no wrong way to learn C++, (other then confusing it with C) if you feel comfortable using the book just use it.
#4 Members - Reputation: 112
Posted 02 July 2012 - 05:20 PM
You should try making some programs, if the book has exercises do them. Theirs also tutorials online for C++. http://www.learncpp.com/, http://www.cplusplus.com/doc/tutorial/.
I got a C++ book on the front of me. Are there any methods of learning C++ execpt reading it off...? Share your learning experience...!
Theirs really no wrong way to learn C++, (other then confusing it with C) if you feel comfortable using the book just use it.
There's some program exercises on the book but there's no answers to the program so I didn't do them. However, I did the ones with the answers on them.
#5 Members - Reputation: 112
Posted 02 July 2012 - 05:20 PM
You could try pressing your face against the book and learning through osmosis, but I doubt you will have much success.
Seriously, how much effort is it to read a book. Read it, then you will know how useful it was teaching you C++!
Ok I'll try to press my face against the book and learn
#6 Staff - Reputation: 8925
Posted 03 July 2012 - 12:02 AM
The book probably doesn't provide answers for all of the example problems because there is more than one way to correctly solve the problem; if you can write a piece of code that compiles and produces the correct result, you can consider that program to be correct.
Read your book.
Attempt all the exercises it provides.
Make up your own variations on the exercises in the book; "I want to take this program, but instead of outputting this, it should output this slightly different result." Make the necessary changes and check it if works; if it does you can move on, but if you were wrong there might be a flaw in your understanding of the material, and you have an excellent opportunity to learn more by finding out why your change did not have the desired result as well as what you could have done instead.
Take examples from the book that you have already got working, and make one completely random change to them. Just delete a character, or move something to a different line, or whatever. See what happens. You might get a compile error -- great, you now have real world experience with what caused a particular error, which may help you if you see that error in future. The program might compile, but will behave differently -- again, a great learning experience to see what sort of results can occur from seemingly simple errors in the code.
Read other sources of information about whatever you are learning. These could be online tutorials, or another book. Do any exercises they provide as well, and have a bit of fun with them as suggested above. If you get to a point where you're completely bored with a particular concept, and are always right about the results of any changes, then it's time to move on.
Create your own exercises. Try to make small games with what you've learned.
Make a "guess the number" game where the computer tells the player "higher" or "lower" until they guess correctly. Make it handle incorrect input (i.e. what should happen if they enter a letter instead of a number?) in some sensible fashion. Give the player the option to try again or exit. Let the player set the difficulty by specifying the range the numbers could possibly be between (i.e. 1-10, or 1-50, etc.).
Make a "hang-man" game where the player has to guess letters and figure out the words. Learn how to load a random word each time. Learn how to load the words from a file instead of including them in the program.
Make a tic-tac-toe (noughts and crosses) game -- you can just draw the board with text. Make it two player. Make a one-player version where the computer makes moves; make it so that the computer will always win if it goes first, or at worst tie the game if it starts second. Make a version where the computer makes believable mistakes.
If you can do all of the above without trouble, you've finished your book and done all the exercises, and you feel comfortable with giving it a go, you might then learn how to create a window and draw graphics with a library such as SFML or SDL. If you're looking for additional exercises to try you might try the exercises at Project Euler.
Practice, practice, practice.
Hope that's helpful!
- Jason Astle-Adams.
From my blog: 20 ways to advertise your game | What next? Intermediate to advanced C++
How to make games WITHOUT programming | 4 reasons you aren't a successful indie developer
#7 Members - Reputation: 144
Posted 03 July 2012 - 07:45 AM
this will make you to be interested in C++ and also develope your thinking,your speed of study will going throw the roof.
Edited by MotorBully, 03 July 2012 - 07:46 AM.
#8 Members - Reputation: 843
Posted 03 July 2012 - 10:30 AM
#9 Members - Reputation: 216
Posted 05 July 2012 - 04:44 AM
That guy (or by now, those guys) teaches tons of stuff via little tutorials (few minutes each), which you can just blaze right through them.
There aren't any exercises (but always examples with easy to understand explanations) and It won't make you an expert, but wou definitely will understand how all that stuff works, so it's a good starting point.
#10 Members - Reputation: 198
Posted 05 July 2012 - 07:49 AM
I think the hardest part of learning a new language is coming up with exercises that are both interesting and manageable (i.e. can be accomplished without spending hours after hour on it.)
C++ is a large and complex language, learn the basics then learn the rest as you need it (it is easy to get overwhelmed imho.)
Also, C++ allows many different programming styles, and the ressource you're using might suscribe to one particular style or philosophy, I think it is useful not to suscribe to one particular style (i.e. not assuming that what you are taught is "the way" or "the only way" to accomplish something in c++.)






