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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:27:59+00:00 2026-06-08T17:27:59+00:00

For example, after we define a variable: int a=2; we can use a as

  • 0

For example, after we define a variable:

int a=2;

we can use “a” as 2 afterwards.
At the time when I first learned c/c++, I took it for granted.
But after I have learned the concept of “pointer” and the address of variables, I am confused.

If int* p=&i;, where “i” is an int. I know that p have the address of i, so we can use *p to get the value of i. But if we go further, how is “p” accessed? It seemed that p must be referenced by name,right?

By now, to access a variable via its address seems more natural to me and easier to understand.
But now , I’m a confused about the mechanism when using the most simple way to access a variable.
As in the case of int a=2; , where is the name “a” stored?

Why if we use “a”, it is equivalent to the behavior of accessing the memory where the “a” or the “2” is stored?

  • 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-08T17:28:00+00:00Added an answer on June 8, 2026 at 5:28 pm

    Here a is just a symbolic name. If it’s a local variable, it ain’t stored anywhere. Compiler simply uses it during the compilation phase, referencing the actual value (which can be on the stack or in register), then discards.

    If you looked at the assembly generated by compiler, you’d notice that a isn’t appearing there (or maybe in comments). Compiler will fit your variable somewhere, and just use that location afterwards (like the eax register on x86).

    If you looked at an LLVM assembly (which is quite interesting), you’d notice that the compiler just treats your variables as @1, @2, @3…

    On the other hand, if a would be a global variable (and a non-static one), the name would actually be used in the symbol table to reference the variable. But it’d be the other way around — variable would be placed somewhere without the name, and the symbol table would map that name to the location so that other programs could find it.


    As a side note: if the program is compiled with debug data, the name a is stored there so that the debugger could display it to help you understanding what’s happening.

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

Sidebar

Related Questions

iam trying play animation with xcode,in specefic Time for example after 3 minutes play
How can I display a new window in JavaFX 2.0? For example after button
I have a outsource data from : http://example.com/data/news.json Here is the example result after
Example: before: text_before_specific_character(specific_character)text_to_be_deleted after: text_before_specific_character I know that it can be done with sed
For example I have created cluster with 1GB RAM memory per node. After some
I have a C header file like this: #ifndef RENDERER_H #define RENDERER_H static int
I lack industry experience with the language. But in my spare time I have
You can define 2 variables of the same type in a for loop: int
Is it posible to re-cache app.config? for example after changing some fields in app.config
Here's what I'm trying to achieve: Before: www.example.com/index.php?page=about&pg=5 After: www.example.com/about.html?pg=5 The URL must specifically

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.