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 |
Write a program to reverse a linked list?
8 Answers Catalytic Software, Satyam,
What are the 3 levels of programming languages?
How to defines the function in c++?
If we declare two macro with the same identifier without doing undef the first, what will be the result? eg: #define MAX_SIZE 100 #define MAX_SIZE 200 int table1[MAX_SIZE];
what does the following statement mean? int (*a)[4]
Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300â€Â,â€ÂBullCart : 10â€Â) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side
Name some pure object oriented languages?
What is function overloading c++?
How do you declare A pointer to a function which receives nothing and returns nothing
Can we use resume in error handling i.e. in the catch block
What is the role of copy constructor in copying of thrown objects?
structure contains int, char, float how it behaves for big endian and little endian?