What is size of a object of following class?
class Foo
{
public:
void foo(){}
}
Answers were Sorted based on User's Feedback
Answer / sirama
Size of the Object 1 Byte (ie) 8 bits. Because that is
minimum possible size required to allocate something on
memory.
Say If a Create the Object like Foo obj;
Something needs to loaded on Stack. But, actually it does
not have any internal data memebers. Hence, the minimum
possible is 1 Byte.
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / 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 |
A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one litre of milk is $0.38, and the profit of each carton of milk is $0.27. Write a C++ program that prompts the user to enter the total amount of milk produced in the morning. Then display the number of milk cartons needed to hold milk, the cost of producing milk, and the profit for producing milk.
what are the events occur in intr activated on interrupt vector table
What is Pure Virtual Function? Why and when it is used ?
WHAT IS THE ABREVATION OF FORTRAN?
How does the copy constructor differ from the assignment operator (=)?
What is a flag in c++?
What are the techniques you use for debugging?
what is polymorphism?
What is a float in c++?
What is a multiset c++?
There is a array of 99 cells and we have to enter 1-100 elements in it , no two elements would repeat , so the is one no. missing because 99 cells and 1-100 nos. so we had to implement a function to find that missing no.
difference between macro and function?