Numbers are what makes the computer’s world go ‘round, so let’s examine ways to get the computer to handle those numbers for us.
Variables
Variables might seem like the letters we use in algebra – y=mx+b, that sort of thing – but in C++, they’re just places to store numbers (among other things). Example
3-1 shows what it looks like when we create variables.
int main (int argc, char** argv)
{
int seasonsOfAmericanIdol = 17;
//after a while you lose track
float hoursIveWatchedAmericanIdol = 424.5F;
//missed half an episode, ...