[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2015-01-24
2
Medium Priority
?
76 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 2000 total points
ID: 40568255
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
ID: 40604696
how can I see the content of virtual method table? is there any tool for developers?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

872 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