What is size of a object of following class?
class Foo
{
public:
void foo(){}
}

Answer Posted / jitendra varshney

The size of the object here will be 1. Because by default,
if no variable is declared in the class the size of object is 1.
this is due to fact that when two or more object of the
class is defined then they would have the different
addresses. But if size would have been zero then it might be
possible that two or more object can have the same address.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are literals in C++?

590


What is boyce codd normal form in c++?

690


Describe linkages and types of linkages?

561


Who discovered c++?

558


What is virtual base class?

567






Is linux written in c or c++?

547


What kind of jobs can I get with c++?

591


What are the basics of local (auto) objects?

630


What are function prototypes?

642


Explain container class.

685


Is c++ the best programming language?

536


A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.

3404


Can turbo c++ run c program?

627


Is eclipse good for c++?

536


What is vector pair in c++?

709