Getting Started

From WikiEducator
Jump to: navigation, search

Important Points before you proceed :
Hear this audio Speech by KK Gupta on PointersAudio icon.jpg
• A variable declared in a C++ program occupies some memory space.
• Every variable is given this memory space randomly.
• Each of these memory spaces given to variables, could be identified by its unique Hexadecimal address, like : 0xAFFC for eg.
• Every variable occupies different length of memory space depending on its data-type (like int, char, float so on…)
• The value assigned to a variable is being stored at the address of the memory location being assigned to it.
• The memory location being assigned to a variable remains reserved till the program scope is alive.

Try to answer (compulsory before you move to later part):
Q : Declare an integer variable and store a value equal to 5 in it.
Q : Declare two variables a and b initialize them with two values and try to swap their values.

Q : Try to execute the following codes and observe the result :

main( )

char points[] = "We are KVians";

 while(points[i] != ‘/0’)
     cout<<points[i]<< “\n”;

Click the following link to put your comments on the above exercises