How much is size of struct having 1 char & 1 integer?
Answer Posted / vadivelt
The size of the stucture depends on the following factors.
1.Depends on the size of the datatype, allocated by compiler
2.Depends on the allignment of the variables in the
structure.
If variables of different datatypes are misalligned, then
badding bytes will be added by the compiler to falitate to
speed up the memory access by the processor.So that the size
of the structure will increase.
Is This Answer Correct ? | 11 Yes | 4 No |
Post New Answer View All Answers
What is auto used for in c++?
What is friend class in c++ with example?
When we use Abstract Class and when we use Interface?where we will implement in real time?
What is the use of vtable?
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.
What does iomanip mean in c++?
Show the declaration for a static function pointer.
If you don’t declare a return value, what type of return value is assumed?
Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work
What does new return if there is insufficient memory to make your new object?
Explain the difference between new() and malloc() in c++?
What is the difference between cin.read() and cin.getline()?
Explain deep copy?
What are destructors?
Differentiate between a template class and class template in c++?