Absolute Beginner Help, please

Im 16 years old and trying to learn how to code on my own, i bought a C++ for Dummies book and I had a few questions. In the book all it does is load me with information such as variables, booleans, and loops and doesn't exactly tell me how to use them. It gives "program examples" to try to show me what they're explaining but I only understand a small portion of the program. Im already forgetting some of the info I learned because it doesn't have you actually use the info, it just keeps giving you more and more and before you know it you're onto another sectionm without even using the info you just learned. Is this normal and should I just keep reading and eventually its supposed to click, or should I learn from a different source? Its making me frustrated, any help is appreciated, thanks :D

The whole idea of those books is to show you commands step by step in a manner where they encourage you to jump into a compiler and experiment.

For example, they may teach you what a For loop does; what they want you to do is start thinking what you could do with that For loop... hmm maybe I could loop 12 times and have my program do my multiplication tables for someone learning them.. cool..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

#include <iostream>
using namespace std;

int main()
{

	int number;

	cout << "Enter table: ";
	cin >> number;

	for (int table = 1; table <= 12; table++)
		cout << table << " x " << number << " = " << table * number << endl;

	return 0;
}

Enter table: 12

1 x 12 = 12
2 x 12 = 24
3 x 12 = 36
4 x 12 = 48
5 x 12 = 60
6 x 12 = 72
7 x 12 = 84
8 x 12 = 96
9 x 12 = 108
10 x 12 = 120
11 x 12 = 132
12 x 12 = 144


Experiment, practice and practice more.. programming doesnt happen overnight. Its all about patience, and the ability to problem solve. If your going to the next section and forgetting the one before then you shouldn't be moving on.

For loops, IF statements and all those other commands that are demonstrated in the book, those little examples may not be much but what they are trying to do is give you a understanding of program flow control (http://www.cplusplus.com/doc/tutorial/control/).

Flow control is needed in everyday applications and games, all those lovely game engines your favourite games run under all need flow control.. has the player walked into a wall?, has all his lives gone?

A good programmer comes with practice, no book will teach you that, they can only show you the commands and syntax.

Happy coding :)
Topic archived. No new replies allowed.