Tutorial search
Tutorials
Stuff
Affiliates
Photoshop Templates
Featured Photoshop templates - professional ready to use designs for your next project.
View all templates
Loops in C++ - C++ tutorial

Loops in C++ tutorial description
| Added on | 05.03.2008 |
| Total clicks | 22 |
| Tutorial Rating | 0 |
| Tutorial Difficulty | 0 |
Loops in C++
More cool C++ tutorials:

To read some text from the command line you use the Console.Read or Console.ReadLine method implemented in the .net framework. The difference between them is that the Console.Read method reads the next character from the command line, whereas Console.ReadLine reads the next line of characters instead of just a simple character. The Console.Read method returns an integer and should be cast to a char during the input. There is also a special function called Console.ReadKey( Boolean display) which obtains the key that is pressed on the keyboard and if the display parameter is false it depicts it.

This tutorial starts from the very beginning, and goes to the more complicated areas of the C/C++ programming. A nice tutorial, if you are beginner, and want to get good C/C++ knowledge to continue to the more advanced levels.

C++ includes two operators not generally found in other programming languages.

Most of beginners define arrays of limited size such as:
int array[100]; // array that can accomodate 100 integer values
These are ok, but your requirement may be different, and you want your application to determines the size of array at runtime, so if your requirement is to use 10 elements only, that means 90 are unused but memory is still allocated for them while application is running. On other hand your application requires 110 elements to be saved, the last 10 will be unallocated spaces if array size is 100, and access to unallocated memory address may result in applciation crash and/or system level damage.
int array[100]; // array that can accomodate 100 integer values
These are ok, but your requirement may be different, and you want your application to determines the size of array at runtime, so if your requirement is to use 10 elements only, that means 90 are unused but memory is still allocated for them while application is running. On other hand your application requires 110 elements to be saved, the last 10 will be unallocated spaces if array size is 100, and access to unallocated memory address may result in applciation crash and/or system level damage.

This lesson is about transformation (casting) of integers and real data types, and explanations why this job is necessary in C language for compiler to understand the syntax. It's a short one, but with compressed value.





