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
What does override mean in c++?
What is an object in c++?
What is the operator in c++?
What is while loops?
Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02
What is the basic concept of c++?
Explain the difference between abstract class and interface in c++?
What is code reusability in c++?
If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?
How would you use the functions randomize() and random()?
How do I start a c++ project?
What is the difference between a reference and a pointer?
What is the most useful programming language?
What is c++ and its features?
What is string in c++ programming?