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

why the size of an empty class is 1

Answer Posted / hitesh sojitra

When you calculate the size of a empty class that time you can c it takes 1 byte.which is the size of a char which a compiler takes for storing the address of a empty class.

The size of an empty class would depend on what is the range specified for the compiler for char. It takes that much space to store the address of a class.

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is name hiding in c++?

1145


How the keyword struct is different from the keyword class in c++?

1023


Which bit wise operator is suitable for putting on a particular bit in a number?

1193


Why should you learn c++?

1008


What are the types of container classes?

1143


How can you tell what shell you are running on unix system?

1100


How would you call C functions from C++ and vice versa?

1145


Will this c++ program execute or not?

1067


Give example of a pure virtual function in c++?

1152


How do we implement inheritance in c++?

1114


What are the five basic elements of a c++ program?

1096


can any one help to find a specific string between html tags which is changed to a sting.. weather.html looks (for location) is somewhere #include #include #include using namespace std; string find_field(string myPage,string); int main (void) { string page, line, location, temperature; ifstream inputFile("weather.xml"); while(getline(inputFile, line)) { page.append(line); line.erase(); } // Now page is a string that contains the whole xml page // Here you need to write something that finds and // extracts location and temperature from the XML // data in the string page and stores them in // the strings location and temperature respectively location=find_field(page,"location"); temperature=find_field(page,"temp_c"); cout << "Location: "<

2036


Differentiate between declaration and definition.

1034


Can a program run without main function?

1134


Describe the advantage of an external iterator.

1027