Solved

24. Do methods affect to the size of an object?

Posted on 2015-01-24
2
46 Views
Last Modified: 2015-02-11
24. Do methods affect to the size of an object?
0
Comment
Question by:Nusrat Nuriyev
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
Comment Utility
The answer is: No. No matter of how many methods a class has, the size is only determined by the data members.

With one notable exception: If you have only one method that is declared as 'virtual', the compiler will add a pointer to a Virtual Method Table, which will increase the class' size by 4 bytes (32bit) or 8 bytes (64 bits).
0
 

Author Comment

by:Nusrat Nuriyev
Comment Utility
how can I see the content of virtual method table? is there any tool for developers?
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now