English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

//please read the question very carefully....else you wont get it.....

#include

class ABC
{
};

void main()
{
ABC a;
cout< }

/* my question is : what is the output of this prog.....ok i give you the answer it's not 0, so if the size of class is determined by the size of the data members contained in it therefore this class should have size zero since it does not contain any data member, in turn the size of its objects is also zero but still the size of objects on ABC class comes to be 1.....Answer this ----> why?
i know the answer, i will answer the question if no one can...
*/

2006-08-14 06:58:50 · 6 answers · asked by DeAd MaN 4 in Computers & Internet Programming & Design

6 answers

I don't know for sure, but I would guess that one byte is needed to designate the type of the ABC object. It seems like that would be necessary to do runtime type checking (something I'm not even sure if C++ does). If it's not that, I would guess that one byte is for the hidden member ABC::this (the pointer that specifies the location of the object in memory). Interesting question. Have a nice day!

2006-08-14 07:07:52 · answer #1 · answered by anonymous 7 · 0 0

3

2006-08-14 07:03:29 · answer #2 · answered by beautiful_crystal_rose 3 · 0 0

Who ever is President of america can't have each and every of the solutions or perhaps if he has all of them he can't execute them with the aid of himself. My estimate is this usa has grow to be a militia powered usa. seem on the billions of bucks that were spent in hands of all kinds contained in the present era. the biggest company contained in the international is generating hands and to produce further and extra armements you would possibly want to be at warfare some position. If we ought to stay in peace there must be no economic issues and there must be very few taxes to pay. maximum wars are all set up. it is now knowned that President Lyndon Johnson once stated to the militia: help me to win the election and that i delivers you with a warfare. next, there become the Vietnam warfare. The wars in Iraq and Afghanistan were set ups. President opt for Obama needs to ends the now ging on wars in Iraq and Afghanistant and produce the lads back residing house. do not newborn your self there are human beings accessible that are operating to do each and every thing they could to make Obama seem undesirable on each and every thing he tries to do. tens of millions of people do not take time to appreciate what ought to correctly be happening in the back of closed doors . they purely noted the each day information on television . All informaitions there are beeing properly managed with the aid of those who managed the economy of this usa. functional cartels controls the economy and an effortless President like Obama does the great he can in his Presidency. I figure that each and every President opt for famous out after he's in ability what the political recreation is all about. There aren't any miracle recommendations immediately and this usa is doomed to pass down, till... God shop united statesa..

2016-12-06 12:56:54 · answer #3 · answered by ? 4 · 0 0

Ok, my guess is that it is a one byte placeholder so that the compiler will have something to put on the stack.

2006-08-14 07:08:18 · answer #4 · answered by Anonymous · 0 0

Nothing, it won't compile. :-P

you forgot "using namespacestd;" :-P

and it's kinda screwed up in other places

but it prints 1

2006-08-14 07:09:28 · answer #5 · answered by Anonymous · 1 1

Do your own homework buddy

2006-08-14 07:09:54 · answer #6 · answered by ☼ Ỉẩη ♫ 4 · 0 1

fedest.com, questions and answers