Okay then, you've come through the last six pages with flying colours and you're ready to take on the world with your new-found C++ ability? You had no problems with the programs and everything that you read made perfect sense? I wish! If that was the case and you're a first time programmer then I must be the best tutor on the planet! That would be a nice scenario but I doubt that this is the case. So if the previous lines do not apply to you then skip this page and carry on to the next one where things will be getting a little trickier.
Now for the rest of you mortals out there that found a few problems and would like to try and get things straight in your heads I have dedicated this page to a complete recap of what we did in the last few tutorials. As I have said from day 1, problems are always going to occur unless you are some sort of natural genius and believe it or not they are good! The more problems that you encounter the better in my opinion, well at least until you get the hang of things. You'll want to cut out the problems at some stage! Remember what I said about breaking down problems into simpler form so that they can be solved more efficiently? Well the more problems that you encounter the more practice you will have at this and the more problems that you solved the more prepared you will be for future problems and you can solve them twice as quick.
So far we have covered the basics of how to program. I have introduced you to the idea of streams that allow input and output. We have seen how variables are used to store and transfer values between functions by parameter passage. We have seen how one simple function can reduce the size of your code by elimating the need for re-writing the same piece of code time after time. We have seen how we can break down seemingly large and complex problems into smaller and very effective implementations without using huge amounts of code. Ultimately we have created a good base for the coding that we will be discussing in later tutorials.
If you found the idea of functions difficult to grasp at first then don't worry, they can take a bit of getting used to. As soon as you get familiar with them though, you'll find yourself using them in every program that you write. Nearly every problem can be fixed using a function and most times the function is the more efficient solution. Later on in our tutorials I will be introducing you to classes. A class is essentially a type. If you read the introduction pages you'll remember that I discussed types before. C++ gives us the power to create our own classes and hence declare objects of our own type. Classes are very important when it comes to designing your own application. Sometimes it is very handy to have one class that will allow everything to be encapsulated in one object as opposed to a multiple object declaration and then trying to keep track of all these objects. A structure is similar to a class but not as powerful by any means. Classes will have their own member functions and will allow very powerful and efficient operations to be coded with ease.
In the programs that you have seen so far you will have noticed certain symbols. '&&', '||', '!', etc. These are what we term operators. Essentially there are two types of operator, a unary operator and a binary operator. The '&&' operator is binary and it means that you are performing a "logical and-ing" of two items. We use this to make comparrissons. The '||' operator is also binary and means that you are performing a "logical or-ing" of two items. The '!' operator is a unary operator and is the "logic not". It means that we can say that something is not equal or not that. For example, the sentinel loops we saw had this not operator to say that the loop should continue as long as the input was "not" a certain value. All these operators and more will be discussed in any good reference book and I can't stress it enough that you should get your hands on one soon. If you can't find these operators in a programming book (highly unlikely) then find a math book that deals with logic and get the background to the functions of the operators. The symbols will be different but the meanings will be the same. I might put up a list of all the most commonly used operators if I get a chance.
Previous | Index | Next |
© Redsetter 2000