struct ptr
{
int a;
char b;
int *p;
}abc;
what is d sizeof structure without using "sizeof" operator??

Answer Posted / kk

12 is answer
int a takes 4 bytes
char b takes 4 bytes due to data padding
int *p any pointer takes 4 bytes
so totally 12 bytes........

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the difference between a free-standing and a hosted environment?

630


What is static identifier?

693


Explain what is the benefit of using enum to declare a constant?

579


What is c token?

599


Is c programming hard?

566






What are the different types of data structures in c?

593


Explain the use of keyword 'register' with respect to variables.

585


Explain what happens if you free a pointer twice?

602


Where static variables are stored in c?

581


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

1777


What is use of #include in c?

588


What is scope of variable in c?

553


cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

626


What are pointers really good for, anyway?

606


What is a macro?

650