Find out size of any structure using pointer?

struct  ABC{
    int a;
    float b;
    char c;
};
void main(){
    struct ABC *ptr=(struct ABC *)0;
    ptr++;
    printf("Size of structure is: %d",*ptr);
}


Explanation:
Read pointer arithmetic

No comments: