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


Please Help Members By Posting Answers For Below Questions

What is std namespace in c++?

726


In a function declaration, what does extern mean?

640


Differentiate between declaration and definition.

590


If a function doesn’t return a value, how do you declare the function?

620


What is difference between rand () and srand ()?

596






Is c++ double?

566


Why c++ does not have finally?

596


which operator is used for performing an exponential operation a) > b) ^ c) none

610


What is the prototype of printf function?

662


Is java based off c++?

536


what is VOID?

636


What is pure virtual function?

633


What is a constant? Explain with an example.

563


What are c++ tokens?

596


What's the "software peter principle”?

627