variables

Well, I dont know what variables do. I get "variables" but I dont know what they do for a program help...
well variables vary. Programs tend to be dynamic. You may have 5 enemies to kill but once you kill one you now only have 4. The brain of the program has to know to now only check information that pertains to 4. Very weird to explain, it would be like trying to teach someone numbers. Once you code more it will make more sense. Especially when you get into doing things over and over like looping

Take care young grasshopper

erock
im 10 dont use big words...
For a basic thing on what variables are...

A variable stores a bit of information. This bit of information you can change. For example, you might say you are '10', and store it in a variable. When you grow older, you are know 11. So, know you can change the variable to be '11'. Here is how it might be done in C++:
1
2
3
4
5
6
7
8
int main() {
    int myAge = 10; // set your age to 10

    // grow older
    myAge = myAge + 1; // set your age to be 11.

    return 0;
}
Topic archived. No new replies allowed.