Welcome to tutorial number three!
Now before we code anything else lets talk a bit about the code we wrote.
The first thing we are going to talk about is comments. This is a comment:
Every thing behind the '//' is part of a comment. If you type in '//' it will make the whole line a comment. However, if you type in '/*' it will make all the lines a comment. This type of comment needs to be closed with '*/'. It doesn't matter where you put the comments because when the computer compiles the code, it skips over the comments. Like so:
The main purpose of comments is to remind yourself what the code does.
Allright now lets talk about white space. White space is the blank space between the code. The white space can be arranged in any way. As long as you end your code line with a semicolon, you can arange your code in any way. Like so:
Be carfull though. Spaces inside strings are not ignored. For example you could not write "firstName" as fir st Name. Symbols that have an actual meaning must be kept intact. Also note that the #include directives are special kinds of statements that need to be on their own line.
Lastly, lets talk about include directives. In the programs we write we will need to use some code we do not write ourselves. Most of this other code can be in the standerd library, which is a set of C++ standard utility code that ships with your C++ compiler. Some examples of useful code which the standerd library holds are:
) Code for outputting and inputting data to and from the console window
) Functions for computing various math operation such as sine and cosine
) Random number generators
) Code for saving and loading files to and from the hard drive
) Code to work with strings
- LiquifiedGold's blog
- Login or register to post comments




I finally read this- great job!
Nice. I love that comment placement in the second pic. Plus the whole "shiny code" thing. Keep it up!
Nice tutorial Sadie!
Great job!