what is the size of an empty class
Answers were Sorted based on User's Feedback
Answer / som shekhar
1 byte.
Reason being when compiler sees an empty class then then it
assigns a 1 byte memory, since the compiler sees the
declaration of the class so he needs to assign some space in
the memory, and hence assign 1 byte memory to hold the
address of the class.
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / asdf
According to the standard C++03, all classes "shall have
nonzero size."
1 byte is the most common implementation but it is left up
to the vendor.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / ankit sharma
size of empty class is 1 byte.
if object does not point to any resource.
it shows object is null but object also get some space in
memory by default either it is empty or not.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ansari razi
1 Byte,
when compiling the program compiler allocates 1 byte memory.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kaush
1 byte for empty class before assigning the value
Is This Answer Correct ? | 0 Yes | 1 No |
which structured data type is not used in c++? 1.union 2.structure 3.string 4.boolean
When not to use object oriented programming?
What is difference between function overloading and overriding?
write a program to find the largest of two numbers without using for,while,switch,if else, conditional operator and do while using c++ pgmng language
Can an interface inherit a class?
what is the use of template classes in c++
What are the advantanges of modularity
what is the difference b/w abstract and interface?
2 Answers Merrill Lynch, Schneider, Scio Healthcare,
What do you mean by inheritance?
C#.net Interview Question A=10 B=5 C=A+B Print C The above will be given in a multiline textbox. You need to parse the above input, store values for A,B&c. And you have to display the value of C.
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
WILL I GET A guaranteed JOB AFTER DOING bsc()IT) and GNIIT from an NIIT CENTRE??
21 Answers Biocon, MIT, NIIT,