Function returning pointer to void i.e. generic pointer in c

void *srkhan();
void main(){
    int *ptr;
    ptr=srkhan();
    clrscr();
    printf("%d",*ptr);
    getch();
}
void * srkhan(){
    static int temp=9;
    void *p=&temp;
    return p;
}
Output: 9
Post a Comment