struct ptr
{
int a;
char b;
int *p;
}abc;
what is d sizeof structure without using "sizeof" operator??
Answer Posted / gagandeep
The total size would be 5.
Since 'int a' takes 2;
'char b' takes 1; and
'int *p' takes 2 (Note: Any pointer variable would take 2 bytes)
There is no additional size of 'struct' data structure.
Hence 5 is the value.
| Is This Answer Correct ? | 12 Yes | 10 No |
Post New Answer View All Answers
How many types of functions are there in c?
simple program of graphics and their output display
What are pointers?
What is difference between static and global variable in c?
How can I write a function that takes a format string and a variable number of arguments?
What is c mainly used for?
Write a program to print factorial of given number without using recursion?
What does the message "automatic aggregate intialization is an ansi feature" mean?
What is a union?
Is c call by value?
What is modifier & how many types of modifiers available in c?
What is pointer and structure in c?
difference between native and cross compilers
What are the differences between Structures and Arrays?
How many keywords (reserve words) are in c?