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
Can 'this' pointer by used in the constructor?
What is the difference between array_name and &array_name?
What is a nested formula?
What is a node in c?
What is the best way to store flag values in a program?
What the advantages of using Unions?
What do you mean by c?
Write a code of a general series where the next element is the sum of last k terms.
How is null defined in c?
What is the sizeof () operator?
Explain what are preprocessor directives?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
What are file streams?
Why header files are used?
What are the 4 types of functions?