POINTERS IN C.

 #include<stdio.h>


int main()
{
    printf("Let's learn about pointers\n");
    int a=76;
    int* ptra = &a;
    int* ptra2 = NULL;
    printf("The address of pointer to a is %p\n", &ptra);  
    printf("The address of a is %p\n", &a);
    printf("The address of a is %p\n", ptra);
     printf("The address of some garbage is is %p\n", ptra2);
    printf("The value of a is %d\n", *ptra);
    printf("The value of a is %d\n", a);
    return 0;
}

OUTPUT:
Let's learn about pointers The address of pointer to a is 0061FF14 The address of a is 0061FF18 The address of a is 0061FF18 The address of some garbage is is 00000000 The value of a is 76 The value of a is 76

Comments

Post a Comment

Popular posts from this blog

C Program using continue statement

C program of WHILE Loop

NULL Pointer in C.

C Program using DO WHILE loop

C Program using SWITCH statement

New Animated Login or signup page made by HTML, CSS and JavaScript.

C Program to print multiplication table of any number.

C Language Travel Agency Manager Exercise.

STRUCTURE IN C PROGRAMMING.