variables=confusing

Feb 14, 2010 at 6:58pm
I don't understand about variables so can you please tell me the lesson 2 things variables and data types its confusing to me. Thx in advance!
Feb 14, 2010 at 7:00pm
Feb 14, 2010 at 7:02pm
i mean that way they say it is confusing i mean i don't even know what the variables do i just need something like: variables do...
Feb 14, 2010 at 7:09pm
Variables hold information. Often a number.

For example you could use an int to represent someone's age:

1
2
3
4
int myage = 15;

cout << "I am " << myage << " years old.\n"
cout << "Tomorow is my birthday, so I will be" << (myage + 1) << "years old.";
Feb 14, 2010 at 7:14pm
oh! ok so its basicly holding info that can be changed but it always remembers the first number and can add/subtract ect ty!
Last edited on Feb 14, 2010 at 7:25pm
Topic archived. No new replies allowed.