12/21/19

POINTERS


UNIT: - 08

POINTERS
Concept of Pointers
Address operators
Pointer type declaration
Pointer assignment
Pointer initialization pointer arithmetic

Concept of Pointers: -
    1.   Pointer is a variable which store address of another variable of same type.
    2.   It store address of memory location at run time (dynamic).
    3.   Pointer is a derived data-type.
    4.   Pointer is denoted by ‘*’ symbol.

ADVANTAGES: -
    1.    Pointer allows dynamic memory allocation i.e. we can create memory at run time.
    2.   Program performance is increased due to preventing memory wastage.
    3.   They are very much used in dynamic linked list and stacks in data-structure.
    4.   They are very much used in system programming.
    5.   It allows to access a local variables outside the function i.e. data sharing between functions.                                                                             

SYNTAX: -
        
data-type * variable name;
       
  “*” indicates it’s a pointer data type.
         
 “*” is called in-direction operator or re-direction operator.
         
  Example: -
                
                         int a=100, *p;

In the above example ‘a’ is a general variables and * indicates ‘p’ is a pointer type variables.       
                                                                                                                                                                                                                                                                      

No comments:

Post a Comment

Please do not enter any spam link in the comment box and use English and Hindi language for comment.

Latest Update

Queue data structure

Popular Posts