what is the size of a class which contains no member
variables but has two objects??? is it 1 or 2??
Answer Posted / vasanth
class a
{
};
void main()
{
a obj1;
a obj2;
cout<<"sizeof class = "<<sizeof(a)<<endl<<"sixeof
obj1 = "<<sizeof(obj1)<<endl<<"sixeof obj2 = "<<sizeof(obj2)
<<endl;
}
--------------------
always sizeof the empty class is 1 byte and each object it
will tak 1 byte.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Can you please explain the difference between static and dynamic binding of functions?
What are the various storage classes in C++?
Should I learn c++ c?
Does there exist any other function which can be used to convert an integer or a float to a string?
What are the unique features of C++.
Explain how overloading takes place in c++?
What do you mean by function overriding & function overloading in c++?
What is the full name of logo?
Is python written in c or c++?
How do I make turbo c++ full screen?
What is c++ programming language?
Is it possible for the objects to read and write themselves?
What is std :: flush?
What parameter does the constructor to an ofstream object take?
how to access grid view row?