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...


How size of a class can be calulated?

Answers were Sorted based on User's Feedback



How size of a class can be calulated?..

Answer / spoorthi.hebbar

THE SIZE OF THE ATTRIBUTES OF CLASS IS THE ANSWER..

EG.
CLASS DEMO
{
INT A; //IT IS 4 BYTES LONG
INT B; //IT IS 4 BYTES LONG
}
THE TOTAL SIZE IS 8 BYTES.

Is This Answer Correct ?    8 Yes 2 No

How size of a class can be calulated?..

Answer / shweta iyer

Size of a class can be calculated by adding up the size of all its data members.

For example:
class student
{
char name[20]; -----> 4*20=80
int rollno[5]; -----> 2*5=10
......
}

So size of class student is 80+10=90.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Which is best ide for c++?

0 Answers  


Write a single instruction that will find the remainder of integral division when x is divided by y. Have the answer stored in z.

1 Answers  


Write syntax to define friend functions in C++.

0 Answers   HAL,


Explain deep copy and a shallow copy?

0 Answers  


What are the characteristics of friend functions?

0 Answers  


What is static in c++?

0 Answers  


Out of fgets() and gets() which function is safe to use?

0 Answers  


what are function pointers?

0 Answers  


What is difference between c++ and c ++ 14?

0 Answers  


Is map thread safe c++?

0 Answers  


What are the benefits of pointers?

0 Answers  


What is difference between shallow copy and deep copy? Which is default?

1 Answers  


Categories