Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the size of class

Answers were Sorted based on User's Feedback



What is the size of class..

Answer / suresh

Size of an emty class is One Byte. If it has variables the
sum of size of variables If it has Virtual functions
Compiler inserts VPTR. So the size includes VPTR which is 4
bytes

Is This Answer Correct ?    24 Yes 2 No

What is the size of class..

Answer / mvs ravi kumar

Size of all variables present in a class
Plus
add size of int for each virtual function if present.

If the class is an empty class then its size is one byte.
This is because to differentiate between two different
objects of that class.

Is This Answer Correct ?    25 Yes 5 No

What is the size of class..

Answer / raghu

#include <iostream.h>
class A
{
};

void main(int argc,char *argv[])
{
A a;
cout << " Size of Class A's object 'a' is = " <<
sizeof(a);
return;
}


Ans: Size of Class A's object 'a' is = 1

Is This Answer Correct ?    22 Yes 2 No

What is the size of class..

Answer / vijaya

One byte

Is This Answer Correct ?    26 Yes 15 No

What is the size of class..

Answer / ratnesh sachan

Size of an object of an empty class is one otherwise the
size of the class is equal to the sum of the size of the
variables of that class. The size of class dose not depend
on the functions of that class.

Is This Answer Correct ?    7 Yes 6 No

What is the size of class..

Answer / amrit

If class is no member function and member variables its size
will be i byte ,if it have both then size will be addition
of all member variables but when the function is virtual
then it take 4 bytes for it ,if class have more than one
virtual function then size for all the virtual function not
include,it only include first virtual function size which
is 4 bytes.

Is This Answer Correct ?    4 Yes 3 No

What is the size of class..

Answer / saisumanth.nimmagadda

i think size of the class is 1byte

Is This Answer Correct ?    1 Yes 0 No

What is the size of class..

Answer / sahadev tarei

The defoult size of an object is one bite.becouse every
object contains a distinct adress.
class a
{
};
main()
{
a obj;
}
Here the size of obj is one bite.

Is This Answer Correct ?    4 Yes 5 No

What is the size of class..

Answer / preeti

The size of class is equal to size of member variables
present in that class.
EXAMPLE:-
class abc
{
public int x;

};
void main()
{
abc a;
cout<<sizeof(a) ;

}

Is This Answer Correct ?    1 Yes 2 No

What is the size of class..

Answer / dev

the size of an empty class is 12 bytes

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More MFC Interview Questions

What is the difference between ASSERT and VERIFY?

2 Answers  


What is CArchive class dowes?

4 Answers  


What is socket?

3 Answers  


What is the difference between the Encapsulation and Abstraction

25 Answers   HCL, Invensys, TCS, Wipro,


How to handle dynamic menus in MFC?

3 Answers   HCL,


Given two processes, how can they share memory?

2 Answers   Microsoft,


How do you change the properties for a tree view control that is part of the CTreeView class?

1 Answers  


Explain Doc/View architecture

6 Answers   Huawei,


What are the advantages of using Doc/View or SDI over DialogBox

2 Answers  


How to find the mouse entering an image?..while entering need to display next image...

4 Answers  


How to update all the views whenver document got updated ?

1 Answers  


What is stack size in win32 program?

1 Answers   HCL,


Categories