Getting the most out of these tutorials
As you go through these tutorials, we recommend a number of practices to maximize your learning experience:
• Type in the examples by hand and compile them yourself. Do not copy and paste them! This will help you learn where you commonly make errors, as well as becoming familiar with compiler warnings and errors. Don’t just transcribe the programs mindlessly – think about what each of the lines you are typing in does, and how it contributes to the overall program. If you encounter anything that you don’t understand, that’s something to investigate further.
• As you make mistakes or find bugs in your programs, fix them. Try to solve your own problems before asking others for help. Learning how to find and fix errors is a key skill to successful programming. Don’t neglect learning how to use a debugger (we’ll explain how in a future chapter) – it’s a key tool in figuring out where your programs are going wrong.
• Experiment with the examples. Change numbers and text to see what happens. Modify the programs to do additional things (e.g. if a program adds two numbers, make it add three numbers). Try to find different ways to break the programs (if a program asks you to enter a number, try entering a letter instead and see what happens). You’ll learn more by modifying the examples than by simply following them.
• Plan to spend some time with the quizzes. If you’re new to programming, you may find these challenging (and that’s normal, as your brain acclimates to the programming mindset). Don’t be discouraged if you don’t get the right answer the first time. You may need to try several different approaches before you find a path to success. It’s okay to look at the answer if you’re really stuck. Just make sure you understand how the provided answer works before proceeding.
• Write your own short programs using the concepts you have learned. This will reinforce your learning and improve your retention.
—Repost from https://www.learncpp.com/