#52_Void Pointers

 # include <stdio.h>

# include <stdlib.h>
int main()
{
    int a;
    a=5;
    voidptr=&a;
    printf("Address of a is:%d\n"ptr); 
    // printf("The value of a is:%d\n", *ptr);//void pointer cant be derefence directly
    printf("The value of a is:%d\n", (*(int*)ptr));//by casting method void pointer can derefermce
    return 0;
}

Comments

Popular posts from this blog

#64_Funtions for File I/O in C

Ch9_43_Ex3_GuessTheNumber

#24_Stack_using_an_array