|
|
 |
|
 |
 |
|
 |
| |
|
|
|
| |
 |
|
|
A program is usually not limited to a linear sequence of instructions. During its process it may bifurcate, repeat code or take decisions. For that purpose, C++ provides control structures that serve to specify what has to be done by our program, when and under which circumstances.
With the introduction of control structures we are going to have to introduce a new concept: the compound-statement or block. A block is a group of statements which are separated by semicolons (;) like all C++ statements, but grouped together in a block enclosed in braces: { }:
{ statement1; statement2; statement3; }
Most of the control structures that we will see in this section require a generic statement as part of its syntax. A statement can be either a simple statement (a simple instruction ending with a semicolon) or a compound statement (several instructions grouped in a block), like the one just described. In the case that we want the statement to be a simple statement, we do not need to enclose it in braces ({}). But in the case that we want the statement to be a compound statement it must be enclosed between braces ({}), forming a block.
|
[ Microsoft .NET ] [ Sunday 01st July 2007 ] [ Visit : 263 ]
|
|
|
|
|
|
|
|
|
|
|
| |
 |
|
|
Until now, the example programs of previous sections provided very little interaction with the user, if any at all. Using the standard input and output library, we will be able to interact with the user by printing messages on the screen and getting the user's input from the keyboard.
C++ uses a convenient abstraction called streams to perform input and output operations in sequential media such as the screen or the keyboard. A stream is an object where a program can either insert or extract characters to/from it. We do not really need to care about many specifications about the physical media associated with the stream - we only need to know it will accept or provide characters sequentialy.
|
[ Microsoft .NET ] [ Sunday 01st July 2007 ] [ Visit : 1435 ]
|
|
|
|
|
|
|
|
|
|
|
| |
 |
|
|
Once we know of the existence of variables and constants, we can begin to operate with them. For that purpose, C++ integrates operators. Unlike other languages whose operators are mainly keywords, operators in C++ are mostly made of signs that are not part of the alphabet but are available in all keyboards. This makes C++ code shorter and more international, since it relies less on English words, but requires a little of learning effort in the beginning.
You do not have to memorize all the content of this page. Most details are only provided to serve as a later reference in case you need it.
|
[ Microsoft .NET ] [ Sunday 01st July 2007 ] [ Visit : 184 ]
|
|
|
|
|
|
|
|
|
|
|
| |
 |
|
|
They are numerical constants that identify integer decimal values. Notice that to express a numerical constant we do not have to write quotes (") nor any special character. There is no doubt that it is a constant: whenever we write 1776 in a program, we will be referring to the value 1776.
In addition to decimal numbers (those that all of us are used to use every day) C++ allows the use as literal constants of octal numbers (base 8) and hexadecimal numbers (base 16). If we want to express an octal number we have to precede it with a 0 (zero character). And in order to express a hexadecimal number we have to precede it with the characters 0x (zero, x). For example, the following literal constants are all equivalent to each other
|
[ Microsoft .NET ] [ Sunday 01st July 2007 ] [ Visit : 335 ]
|
|
|
|
|
|
|
|
|
|
|
| |
 |
|
|
The usefulness of the "Hello World" programs shown in the previous section is quite questionable. We had to write several lines of code, compile them, and then execute the resulting program just to obtain a simple sentence written on the screen as result. It certainly would have been much faster to type the output sentence by ourselves. However, programming is not limited only to printing simple texts on the screen. In order to go a little further on and to become able to write programs that perform useful tasks that really save us work we need to introduce the concept of variable. |
[ Microsoft .NET ] [ Sunday 01st July 2007 ] [ Visit : 196 ]
|
|
|
|
|
|
|
|
|
|
|
| |
 |
|
|
The first panel shows the source code for our first program. The second one shows the result of the program once compiled and executed. The way to edit and compile a program depends on the compiler you are using. Depending on whether it has a Development Interface or not and on its version. Consult the compilers section and the manual or help included with your compiler if you have doubts on how to compile a C++ console program. |
[ Microsoft .NET ] [ Sunday 01st July 2007 ] [ Visit : 236 ]
|
|
|
|
|
|
|
|
|
|
|
| |
 |
|
|
These tutorials explain the C++ language from its basics up to the newest features of ANSI-C++, including basic concepts such as arrays or classes and advanced concepts such as polymorphism or templates. The tutorial is oriented in a practical way, with working example programs in all sections to start practicing each lesson right away. |
[ Microsoft .NET ] [ Sunday 01st July 2007 ] [ Visit : 178 ]
|
|
|
|
|
|
|
|
|
|
|
| |
 |
|
|
Sometimes the background of a lovely flower or another subject is so messy, you do not want to use the captured image as it comes directly from the camera. One alternative is to provide a new background. |
[ Photoshop ] [ Sunday 01st July 2007 ] [ Visit : 275 ]
|
|
|
|
|
|
|
|
|
|
|
| |
 |
|
|
One quick technique for enhancing the exposure latitude of an image is applying Blend modes to a selection of the highlights. This Adobe Photoshop technique may allow you to enhance the highlight and shadow information contained in the image. Naturally, this won't work on all images and certainly won't fix blown highlights. Landscape images are the images that benefit most with this quick fix.
|
[ Photoshop ] [ Sunday 01st July 2007 ] [ Visit : 264 ]
|
|
|
|
|
|
|
|
|
|
|
| |
 |
|
|
The Dodge or Burn tools in Adobe Photoshop can be a very heavy handed way to make exposure corrections. There are now many different ways to correct lighting and exposure with much more finesse than the Dodge or Burn tools. |
[ Photoshop ] [ Sunday 01st July 2007 ] [ Visit : 269 ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|