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
What are register variables?
Can I run c program in turbo c++?
Can a program run without main?
What is else syntax in c++?
What is istream c++?
What are the two types of comments?
Can I make ios apps with c++?
What is #include math h in c++?
How does atoi function work?
describe private access specifiers?
What is array give example?
Why is c++ still used?
What is atoi?
Evaulate: 22%5 a) 2 b) 4 c) 0
What is a null object in c++?