CPP

58
1718 reads

February 8, 2013

Global & Local variables


This example demonstrates global and local variables, their scopes and scope resolution operator(::).

29
1680 reads

February 8, 2013

Declaration & Initialization


This example demonstrates the declaration and initialization of variables. Variables are used to hold data or useful information.

24
10333 reads

February 8, 2013

Difference between Global and Local Variables


This example demonstrates local and global variables.
Local Variables :

324
3656 reads

February 7, 2013

Initializing String type variables


Just like any other variable, string type variable's are initialized & assigned similarly.
Header file string must be included & data-type should be string.

76
1562 reads

February 7, 2013

Initialization of variables


An easiest way of assigning data to variable is :
data-type variable-name = value
The the assignment of values are done from right-to-left order, according to C++ standards.

33
1557 reads

February 7, 2013

String type Variable


This example demonstrates the usage of strings.

63
1619 reads

February 7, 2013

Declaration of Variables


Declaration of variables are done by writing the data-type followed by a valid variable name. It is a sequence of one or more letters, digits or underscore characters.
30
1642 reads

February 7, 2013

Global Variables


Global Variables are known throughout the program and they may be used by any piece of code. They are very helpful when many functions in your program use the same data.

44
1820 reads

February 7, 2013

Local Variable


Variables that are declared inside a function are called "Local Variable".

Local variables may be referenced only by statements that are inside the block in which the variables are declared.

60
1671 reads

February 7, 2013

Constant Value


The const keyword specifies that a variable's value is constant and tells the compiler to prevent the programmer from modifying it. In C++, you can use the const keyword to define constant values.