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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:19:43+00:00 2026-05-16T16:19:43+00:00

#include<stdio.h> int main(void) { int a[3] = {1,2,3}; printf(\n\t %u %u %u \t\n,a,&a,&a+1); return

  • 0
#include<stdio.h>
int main(void) {
  int a[3] = {1,2,3};
  printf("\n\t %u %u %u \t\n",a,&a,&a+1);
  return 0;
}

Now i don’t get why a and &a return the same value, what is the reasoning and the practical application behind it? Also what is the type of &a and could i also do &(&a) ?

  • 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-16T16:19:43+00:00Added an answer on May 16, 2026 at 4:19 pm

    Now i don’t get why a and &a return the same value, what is the reasoning

    a is the name of the array that decays to pointer to the first element of the array.
    &a is nothing but the address of the array itself, although a and &a print the same value their types are different.

    Also what is the type of &a?

    Pointer to an array containing three ints , i.e int (*)[3]

    could i also do &(&a) ?

    No, address of operator requires its operand to be an lvalue. An array name is a non-modifiable lvalue so &a is legal but &(&a) is not.

    Printing type of &a(C++ Only)

    #include <typeinfo>
    #include <iostream>
    
    int main()
    {
       int a[]={1,2,3};
       std::cout<< typeid(&a).name();
    }
    

    P.S:

    Use %p format specifier for printing address(using incorrect format specifier in printf invokes Undefined Behavior)

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

Sidebar

Related Questions

#include<stdio.h> void function(int); int main() { int x; printf(Enter x:); scanf(%d, &x); function(x); return
#include<stdio.h> void main(){ int x,y,z; x=y=z=1; z=++x||++y&&++z; printf(%d %d %d \n,x,y,z); getch(); } the
#include <stdio.h> void wrapperPrint(char* s) { printf(s); return; } int main() { wrapperPrint(Hello world\n);
consider the code #include<stdio.h> int main(void) { char* a; scanf(%s,a);//&a and &a[0] give same
#include<stdio.h> #include<conio.h> int main (void) { int a,b,c,d; clrscr(); a=3; b=5; c=a,b; d=(a,b); printf(c=%d,c);
#include<stdio.h> void foo(int **arr) { arr[1][1]++; } main() { int arr[20][20]; printf(%d\n,arr[1][1]); foo((int**)arr); printf(%d\n,arr[1][1]);
Consider the following program: #include <stdio.h> int main(void) { return 0; } When i
#include<stdio.h> #include<signal.h> #include<stdlib.h> void handler(int signo) { printf(First statement); system(date); exit(EXIT_SUCCESS); } int main()
#include <stdio.h> #include <stdlib.h> int main(void) { int x; int *in, *begin; in =
Here is my code: #include <stdio.h> int main(void) { FILE *fp; unsigned int i;

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.