Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Pointers in C language

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 279
    Comment on it

    Pointer is a variable which stores address of another variable. It points to an address of a value. Pointers in C language is declared using * i.e. asterik symbol.

    int *i;//pointer to int
    char *ch;//pointer to char .

    Example

    #include <stdio.h>      
    #include <conio.h>    
    void main(){      
    int num=20;  
    int *b;    
    clrscr();  
    b=&num;//stores the address of num variable  
    
    printf("Address of number variable is %x \n",&num);  
    printf("Address of p variable is %x \n",b);  
    printf("Value of p variable is %d \n",*b);  
    
    getch();      
    }      
    

    Output

    Address of num variable is fff4
    Address of b variable is fff4
    Value of b variable is 20

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: