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
Can a constructor be private?
What is the use of endl?
What is singleton class in c++?
What is pointer to array in c++?
Evaulate: 22%5 a) 2 b) 4 c) 0
What is #include cstdlib in c++?
Out of fgets() and gets() which function is safe to use and why?
Is empty stack c++?
Is java made in c++?
What is using namespace std in cpp?
What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0
What is the difference between strcpy() and strncpy()?
why is c++ called oops? Explain
Can user-defined object be declared as static data member of another class?
Differentiate between a copy constructor and an overloaded assignment operator.