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 size of empty class object

Answers were Sorted based on User's Feedback



What is size of empty class object..

Answer / manish shikarbar

answer is :1

Example:

class Test
{
};

Test Obj;

int size = sizeof(Obj); // answer is 1

Is This Answer Correct ?    9 Yes 1 No

What is size of empty class object..

Answer / kaminee

1

Is This Answer Correct ?    9 Yes 3 No

What is size of empty class object..

Answer / shanky

ans-1.

Is This Answer Correct ?    6 Yes 0 No

What is size of empty class object..

Answer / orvaishnavi

The size of an empty class is 1.
Reason - An object of a class should have unique address.
In order for the object to get unique address, the compiler
inserts a dummy type of size 1(least positive value) into
the empty class so the sizeof the class is returned as 1.

Is This Answer Correct ?    5 Yes 0 No

What is size of empty class object..

Answer / vinay singh

the size of class is nothing until it will not create an object. Class is a template so class object size is determined.So here empty class object size is 1 byte and object is created on managed heap.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?

0 Answers  


Is it possible for a member function to delete the pointer, named this?

0 Answers  


What are the difference between reference variables and pointers in C++?

1 Answers  


What is a 'pure' virtual function and what's its use?

1 Answers  


Explain mutable storage class specifier.

0 Answers  


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

0 Answers  


What is virtual destructor ans explain its use?

0 Answers  


what are the events occur in intr activated on interrupt vector table

0 Answers   HGS,


What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h

0 Answers  


Write a program to concatenate two strings.

0 Answers  


What do manipulators do?

0 Answers  


Can I learn c++ in a week?

0 Answers  


Categories