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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:10:40+00:00 2026-05-11T05:10:40+00:00

Suppose we have these local variables: int a = 0; int b = 1;

  • 0

Suppose we have these local variables:

int a = 0; int b = 1; int c = 2; int d = 3; 

As far as I know, these will be allocated on the system stack, like this:

|   | | 3 | d | 2 | c | 1 | b |_0_| a 

Does this mean that in order to get the value of a, the values of d, c and b must first be popped out of the stack? If so, where do these values go? Does this mean that accessing more recently declared variables will be faster? Or am I missing something (which I suspect is the case), and the whole thing works in some other way?

EDIT: thanks, guys!

  • 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. 2026-05-11T05:10:41+00:00Added an answer on May 11, 2026 at 5:10 am

    The local variables on the stack are usually accessed relative to the so-called frame pointer, which points at the start of your stack frame. It would also be possible to do this relative to the stack pointer, but since this moves around during evaluation of expressions it is more difficult to keep track of.

    In practice such variables may also be kept in processor registers.

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

Sidebar

Related Questions

Suppose I have these domain objects: DataPoint ========= public int Id {get;set;} public int
Let us suppose i have these three methods defined: int F1(int, int); int F1(float,
Suppose I have an IEnumerable<int> and I want these to be converted into their
Suppose you have two linked servers called Local and Remote respectively. Is there a
Suppose you have these modules: module1.py import module2 def a(): module1.b() def c(): print
Suppose you have these tables: Table Name: Salesman Fields: S_ID(Primary Key), Name Table Name:
Let's suppose I have all of these already provided: The name of a table
Suppose I have several services represented by classes ServiceA, ServiceB, ServiceC etc. These services
Suppose that I have n points (x,y1),(x2,y2),.....(xn,yn) my aim is to connect these points
Suppose that I have those three files: a.h //a.h header #include <stdio.h> int int_variable;

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.