So today I'm going to tell you how what the code from yesterday means. Opposed to going line by line, explaining everything, I'm instead just going to explain what the major parts of the program mean.
First, "cin" means console input. This is where people type into the console.
"if(selection == 1)" means that if the user inputs one as their selection, the following code will execute.
"cout" means console output. This is all of the stuff that gets displayed in the console window.
"Sleep()" is a function I have explained before. Basically, it pauses the output in the console.
"endl;" ends the line. This pretty much simulates pressing the "enter" button in the console output.
Any text between quotation marks are strings.
"else" is what executes if the user types anything other than 1 (more options will be added soon).
"char" is a character.
"||" is an or operator.
Hopefully I've explained everything that may be foreign to someone who doesn't know C++. If you use the above as a guide, you should be able to piece together at least a basic understanding of what is happening. Trust me, none of this is advanced so anyone with at least a little bit of knowledge in C++ won't even need the above information. If you have any trouble understanding what is happening, I recommending reading a basic C++ tutorial online.
Subscribe to:
Post Comments (Atom)
11 comments:
I want to learn how to do this stuff myself, guess I better start paying attention more. :P
Are you going to post anything that you make?
Interesting blog. Keep it up!
this takes me back to my early days programming. You're doing a great service to others friend
thanks for the post. really informatve and i learnt something new today :P
Im with Admin,post some of your stuff!
interesting post but I got lost lol
what's with the lack of comments people? :(
can't wait for next post m8
Seems cool enough.
Seems cool though I'm not quite understanding what it is, do you have pictures of it in action?
Post a Comment