How much is size of struct having 1 char & 1 integer?

Answer Posted / raja

you will have to study through structure padding concepts.
It depends on the compiler.
struct
{
char a;
int b;
}
The above struct size will be 8 in standard compilers (Turbo
C is a non-standard compiler). bcoz between a and b there
will be 3 pad bytes placed..

Refer this link you will know everything about structure
padding..All d best :)
http://www.allinterview.com/showanswers/62991.html

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need runtime polymorphism in c++?

645


give me an example for testing a program showing the test path .show how the test is important and complex.

2533


How does code-bloating occur in c++?

836


Are vectors faster than arrays?

653


How many keywords are used in c++?

659






Is c++ pass by reference or value?

661


When do we run a shell in the unix system? How will you tell which shell you are running?

636


What is the difference between a baller and a reference in C++?

669


Can create new c++ operators?

654


Can class objects be passed as function arguments?

695


What is the difference between function overloading and operator overloading?

663


What are the advantages of early binding?

700


Does c++ have a hash table?

655


Is c++ fully object oriented?

642


What are abstract data types in c++?

648