Sunday, July 17, 2011

when will you declare a variable as a pointer variable

first understand the meaning of this declaration below :
                           
                                                 int a=10;
                                           
                                     
                                              
The statement describes the  variable (a) which holds the value 10 in a address in memory.Now the point to be noted is variable (a) contains a value.




But at the same time if the variable wants to hold address as a value like mentioned below

                                             a= address of another variable

then you have to declare this variable as a pointer variable like this
                                            int *a ;

No comments:

Post a Comment