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 is c++ hiding?
What is the best c++ compiler?
Specify some guidelines that should be followed while overloading operators?
What is flush programming?
Where and why do I have to put the "template" and "typename" keywords?
Is empty stack c++?
What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
write a program that reads in a file and counts the number of lines, words, and characters. Your program should ask the user to input a filename. Open the file and report an error if the file does not exist or cannot be opened for some other reason. Then read in the contents of the file and count the number of lines, words, and characters in the file. Also print additional information about the file, such as the longest and shortest words, and longest and shortest lines. For simplicity, we define a word to be one or more characters ending with white space (a space, tab, carriage return, etc.). Functions for checking the types of characters can be found in the ctype.h header file, so you want to include this header file in your program. For example, the sentence below could be all that is in a file. This sentence IT 104 is taught in C++. has 32 characters, one line, and six words. The shortest line is 32 characters. The longest line is 32 characters. The shortest word is 2 characters. The longest word is 6 characters
What is late binding c++?
Is atoi safe?
What are the uses of static class data?
What is the use of 'this' pointer?
Explain dangling pointer.
On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?
which of the following is not an secondary constant a) array b) real c) union