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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:15:03+00:00 2026-05-31T05:15:03+00:00

int a; printf(address is %u, &a); Which address is this..? I mean is this

  • 0
int a;
printf("address is %u", &a);

Which address is this..? I mean is this a compiler generated address i.e. virtual address or the loader given physical address in the RAM..?

As it prints different address every time, I guess it must be address in the RAM. Just want to make sure.

Please provide any links which give reference to your answer.

  • 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-05-31T05:15:04+00:00Added an answer on May 31, 2026 at 5:15 am

    The correct answer is: “it depends.”

    (The printf should use the “%p” directive, and cast the address to “void *”, for the sake of well-defined-ness:

    printf("%p\n", (void *)&a);
    

    although using %u no doubt works for your particular compiler with whatever flags you are using.)

    As @Alex noted, the address is virtual if translation is going on (as with most modern OSes, or even when running in “emulated physical” under a virtual machine). The address itself is generally determined at link or load time if “a” has static storage duration, but at runtime (on the stack as @Als said) if not. Variables declared “static” or “extern” have static duration; variables declared outside function bodies have static duration; and variables declared within function bodies, but without using either “extern” or “static”, have automatic storage duration (and are thus usually on “the stack”—though there can be more than one stack, as when using POSIX threads).

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

Sidebar

Related Questions

int i=10; printf(Address of i = %u,&i); Output: Address if i = 3220204848 Output
int[] arrc = new int[] {1, 2, 3}; System.out.println(new ArrayList(Arrays.asList(arrc))); prints address, but i
Consider this code: void res(int a,int n) { printf(%d %d, ,a,n); } void main(void)
Given a simple switch statement switch (int) { case 1 : { printf(1\n); break;
int x; printf(hello %n World\n, &x); printf(%d\n, x);
int main() { int *d=0; printf(%d\n,*d); return 0; } this works fine. >cc legal.c
#include <stdio.h> int main (){ int x=10,*a=&x; int *b=(int *)&a; printf(%d %d %d %d
Session transcript: > type lookma.c int main() { printf("%s", "no stdio.h"); } > cl
#include<stdio.h> int main() { printf(He %c llo,65); } Output: He A llo #include<stdio.h> int
I have a library I created, File mylib.c: #include <mylib.h> int testlib() { printf("Hello,

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.