To find the size of structure without using sizeof operator
Here's the program:
struct Sample{
int a;
char b;
float c;
};
int main(){
struct Sample *ptr = (struct Sample *)0;
ptr++;
printf("Size of the structure is : %d",*ptr);
return 0;
}
No comments:
Post a Comment