Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8157499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:18:23+00:00 2026-06-06T17:18:23+00:00

I am currently reading Inside the C++ Object Model. On page 9 it has

  • 0

I am currently reading Inside the C++ Object Model. On page 9 it has a diagram showing how the contents of a class are laid out in memory. It states the only part of an object which actually resides in the class memory are non-static data members.

Here is a post from SO regarding the contents of memory for a program:

Global memory management in C++ in stack or heap?

In the second answer it details the memory layout of a program- showing the stack and the heap.

Does the location of the static data members/any class function (basically the parts of the class which are not stored within the object- referring to page 9) change depending whether the object is on the stack or the heap?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:18:25+00:00Added an answer on June 6, 2026 at 5:18 pm

    Static data members reside in the same area of memory that global variables and plain static variables would reside. It is the “class memory” that could either be on the stack or heap, depending on how the instance of the class was created.

    A static data member is not too different from a global variable. However, it is scoped by the class name, and its access by name can be controlled via public, private, and protected. public gives access to everyone. private would restrict access to only members of the class, and protected is like private but extends access to a class that inherits from the class with the static data member.

    In contrast, a global variable is accessible by name by everyone. A plain static variable is accessible by name by code in the same source file.

    A plain class method is actually just a regular function (modulo access controls), but it has an implicit this parameter. They do not occupy any space in a class. However, a virtual class method would occupy some memory in the class, since it has to resolve to a derived class’s implementation of the method. But, polymorphism is likely not yet covered where you are in your textbook.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im currently reading a book about programming Android and there is a nice little
I am currently reading Developer's Workshop to COM and ATL 3.0. Chapter 3 introduces
I'm currently reading Dive Into Python by Mark Pilgrim, and have gotten to the
I'm currently reading the book Pro Asp.Net MVC Framework. In the book, the author
I'm currently reading chapter 5.8 of Dive Into Python and Mark Pilgrim says: There
I'm currently reading the book Professional Enterprise .NET and I've noticed this warning in
I am currently reading High Performance JavaScript by Nicholas C. Zakas and in the
I am currently reading though this tutorial here And in it he seems to
I am currently reading Dive into HTML5 and I've got a question regarding the
I have started to learn about python and is currently reading through a script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.