Beginners Guide to C++ Programming - Part 2
Easy to Follow Instructions
Before we get into the code we are going to go over a basic tool, a variable. If you do not know what a variable is then you’re in big trouble! Just kidding, I will explain what a variable is. If you remember math class in school then you should have an idea of what a variable is.x = 2 + 2The answer to this equation should be apparent but it is still represented by the letter x. It is basically a ‘holding’ spot for when you want to write an equation down and your really do not know the answer to. Say for instance we change the above equation to the following:
456 / 5 * 6 + 99 *46 / .09 = ?Now the answer to that equation isn’t very evident. Mixing grammar and math is bad practice and they do not go well together. Instead of using the ? symbol you would use the letter X. Regardless if you know the answer to the above question or not, you do know that the answer IS x, whatever x may be. Variables in math work similar to variables in almost any programming language. The best part of using variables in a programming language is that they can be made up of whatever you can think up. However there are a few rules you have to follow.
- Has to start with a letter
- Can not use reserved keywords (we will get into this later)
- Can not use mathematical or foreign characters (nothing like ¿ ( á + -↓+? )
- Can not be the same as a previous variable.
Related information
- Variables add an immense amount of power to the C++ programming language
- Keywords are identified by bold words.
- Part 3 Coming Soon!
Most Comments Today
- Death at Disney World in Orlando, Florida Monorails collide one driver has died at the Disney World Theme Park in Orlan... 23 Comments
- Why Would a Web Writer Drop DayLife.Com? Before I share my story with you, dear readers, I want to point out that Dayl... 22 Comments
- Give a Damn Another new song, this one describes the feelings of us who save the world ev... 22 Comments
- Is Obamageddon Coming? The times they are a changin' - but are we hurtling toward Armageddon - or as... 20 Comments
- A Little Good News Today Here is...a little good news today. 18 Comments
- Bachelorette 5 Spoiler: Wes Hayden Spills the Beans About... This week July 6, 2009 episode 8 of the Bachelorette Jillian will finally d... 18 Comments






