Pointer is that variable which stores the memory address of another variable. It means pointer is itself a variable which stores hex-decimal address of the location.
Showing posts with label loop. Show all posts
Showing posts with label loop. Show all posts
January 30, 2013
Pointers in C++ (OOPs)
Pointer is that variable which stores the memory address of another variable. It means pointer is itself a variable which stores hex-decimal address of the location.
January 29, 2013
Arrays in C++ (OOPs)
Array is an arrangement of same type of data at adjacent memory locations. Array is useful whenever large volume of data is to be processed and stored in the memory.
Suppose an average marks are to be calculated from all the students in the school. This is difficult to find the sum of marks of all students. In this situation an array is the best alternative. Its divided in two categories:
1. Single / 1-D Array
2. Multi-dimension Array
Loop Control- for loop in C++ (OOPs)
“for” loop is also structure control loop as program will run or execute if the initial condition is true otherwise it will terminate and program will run until some condition is fulfilled.
FORMAT:
for(expression1;expression2;expression3)
{
Statement1;
Statement2;
}
Switch Statement in C++ (OOPs)
This statement is also used for decision making. Here key word is switch followed by control variable and followed by it’s block.
In the block of switch statement multiple cases are used and each ends with break statement this is also called as early exit loop.
Out of all the cases only that case will run whose value matches with the control variable.
Loop Control- While & Do-while in C++ (OOPs)
These are used for repeating some portion of the program either by specified number of times or until a particular condition is true.
1. while statement
2. do while statement
3. for loop
January 21, 2013
Loop Control- Nested for loop
Loop Control- for loop
“for” loop is also structure control loop as program will run or execute if the initial condition is true otherwise it will terminate and program will run until some condition is fulfilled.
FORMAT:
for(expression1;expression2;expression3)
{
Statement1;
Statement2;
}
Loop Control- While & Do while loop
These are used for repeating some portion of the program either by specified number of times or until a particular condition is true.
1. while statement
2. do while statement
3. for loop
Subscribe to:
Posts (Atom)