What is size of a empty class?

Answer Posted / ganesh

when ever an datamember is not the part of the class then default value for object size is 1 byte.
but if int a;
char c;
then it will consume 3 bytes .........

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is #include cstdlib in c++?

665


What is basic if statement syntax?

572


How is c++ used in the real world?

576


What is array give example?

603


In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that

620






what kind of projects are suitable for c and c++

631


What happens when you make call 'delete this;'?

605


How do you clear a set in c++?

605


What does return 0 do in c++?

581


Is atoi safe?

603


What is ios flag in c++?

691


What is string in c++ programming?

628


Do you know the use of vtable?

638


What is the difference between mutex and binary semaphore?

616


What is a static member?

619