Your IP : 216.73.216.40


Current Path : /var/www/html/bibhas.ghoshal/ITP_2019/lab/
Upload File :
Current File : /var/www/html/bibhas.ghoshal/ITP_2019/lab/intro_pointers.c

//
//  intro_pointers.c
//  
//
//  Created by Bibhas Ghoshal on 20/02/21.
//

#include <stdio.h>
int main()
{
    int x =420;
    int *p;                                         // p has type int //
    
    printf("values of x = %d\n",x);
    printf("Uninitialized value of pointer p = %p\n",p);
    
    p = &x;                                         // p stores address of x //
    
    printf("Initialized value of pointer p = %p\n",p);
    printf("Value at address pointed to by pointer p = %d\n",*p);
    printf("Uninitialized value of pointer p = %d\n",*p);
    printf("This is the same value as x:%d\n",x);
    
    *p = 840;                                              // Same as x= 840;//
    printf(" New value of x:%d\n",x);
    
    return 0;
    
}