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 8678945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:51:00+00:00 2026-06-12T20:51:00+00:00

My question is : Are the name of the variable and the data itself

  • 0

My question is : Are the name of the variable and the data itself both stored in the stack?

I would like to know how the name of the variable is linked to the address memory in the stack (the data) and what does it.

Also how does anything know the number of bytes the type of the variable is composed of and how does it decides to read these exact number of bytes in the stack?

Does all the data stored in the stack occupy the same space, no matter the type of data it is?.

And the same questions with 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-12T20:51:01+00:00Added an answer on June 12, 2026 at 8:51 pm

    Generally, I believe the following to be true in most practical implementations:

    No, the name and actual data are not both stored on the stack.

    The compiler keeps track of where the variable is on the stack, and when the compiler is done, all references to the variable (ie the name) has been substituted by a proper increse/decrease of the stack pointer to address the memory area where the data is stored.

    No, they do not occupy the same space. A 4 byte var takes up 4 bytes. A 1000000 bytes variable take up 1000000 bytes (but that’s not recommended, usually).

    The heap is a bit different… Maybe this page can answer your question a bit more: http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap

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

Sidebar

Related Questions

This may sound like a dumb question, but does assigning a variable to a
Given the sample console application below: QUESTION #1 : Why does .Name() return typeof
My question is how to assign the data of the table to any variable..
EDITED QUESTION: I have 2500 rows x 100 columns data in variable named avg_data_models.
Question: I need to create a dropdownlist like this: <select id=ddCustomers data-placeholder=Choose a customer
I have a question about meta name and keywords: If I have more oages
I'm not sure how to proper name the question. Please fell free do edit.
Note: I am not exactly sure what to name the question, so if someone
Question 1: When i try to get the name of every added mc i
This question asks about file name the servers sends and the fix was quite

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.