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

What is the need of a destructor?

647


What is the function to call to turn an ascii string into a long?

607


What is encapsulation in C++? Give an example.

594


How do you declare A pointer to a function which receives nothing and returns nothing

731


What are c++ manipulators?

616






Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be

943


What is called array?

624


What are the effects after calling the delete this operator ?

568


What is the this pointer?

642


How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?

1844


What is a breakpoint?

573


What is the use of pointer in c++ with example?

567


Which operator cannot be overloaded c++?

596


Which bit wise operator is suitable for putting on a particular bit in a number?

729


what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?

1782