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

  • Home
  • SEARCH
  • 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 889199
In Process

The Archive Base Latest Questions

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

Possible Duplicate: C: How come an array’s address is equal to its value? SA

  • 0

Possible Duplicate:
C: How come an array’s address is equal to its value?

SA
In C I tried to print the address of the pointer of an array.

int a[3] = {0,1,2};
printf("\n%p",a);
printf("\n%p",(&a));

the 2 statement prints the same value why?
thanks in advance

  • 1 1 Answer
  • 1 View
  • 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-15T13:31:50+00:00Added an answer on May 15, 2026 at 1:31 pm

    Any array argument to a function will decay to a pointer to the first element of the array.

    The C Book has an excellent explanation of this:

    Another case is when an array name is
    the operand of the & address-of
    operator. Here, it is converted into
    the address of the whole array. What’s
    the difference? Even if you think that
    addresses would be in some way ‘the
    same’, the critical difference is that
    they have different types. For an
    array of n elements of type T, then
    the address of the first element has
    type ‘pointer to T’; the address of
    the whole array has type ‘pointer to
    array of n elements of type T’;
    clearly very different

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

Sidebar

Related Questions

Possible Duplicate: C# Why can equal decimals produce unequal hash values? I've come across
Possible Duplicate: Where does ‘Hello world’ come from? What was the first Hello World
Possible Duplicate: Where does ‘Hello world’ come from? Hello world! is the most commonly
Possible Duplicate: Modifying C string constants? Pointer to const char vs char array vs
Possible Duplicate: What's the difference between 'int?' and 'int' in C#? I've come across
Possible Duplicate: Return variable with the highest value? I'm trying to come up with
Possible Duplicate: selecting items that come after a specific value i asked this allready
Possible Duplicate: How come I can't remove the blue textarea border in Twitter Bootstrap?
Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web
Possible Duplicate: How can I convert a list<> to a multi-dimensional array? I want

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.