c-programming.......

pointer:- A pointer is a variable that stores the address of another variable.


  • features of pointer:-


  1.  pointer is save memory space.
  2.  The memory is accessed efficiently with the pointer is dynamically memory is allocated & De-allocated.
  3. Execution time with pointer is faster because data is manipulated with the address i.e direct access to memory location.
  4. Pointer are used with Data-Structures.
  • *(astric) symbol is used for pointer.
  • Declaration of pointer:-
A pointer provide access to a variable by using the address of that variable.

  • A pointer variable is therefore a variables that stores the address of another variable.
        int *p;
  • syntax:-
      Data-Type *pointer name;
  • Example:-
     int pointer ptr;
     
   #include<stdio.h>
   #include<conio.h>
    void main()
    {
    int a= 100;
    int *p;
    int **p1;
    p= &a;
    p1= &p;
printf("\n value of A%d", a);             
printf("%d", *p);                         
printf("%d", **p);
    getch();
             }  

Comments

Post a Comment