What is size of empty class object

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is called array?

617


What is the difference between a pointer and a link in c ++?

560


In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h

673


What is the difference between struct and class?

737


What are the sizes and ranges of the basic c++ data types?

585






Which should be more useful: the protected and public virtuals?

596


Write a program to find the Factorial of a number

568


Can static member variables be private?

624


If you want to share several functions or variables in several files maitaining the consistency how would you share it?

550


Does improper inheritance have a potential to wreck a project?

624


Can we specify variable field width in a scanf() format string? If possible how?

657


Explain how an exception handler is defined and invoked in a Program.

580


What is the difference between a reference and a pointer?

591


How important is c++?

526


Show the declaration for a static function pointer.

574