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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:43:15+00:00 2026-05-26T04:43:15+00:00

If we have an array[5], we know that arr == &arr[0] but what is

  • 0

If we have an array[5], we know that arr == &arr[0]
but what is &arr[2] = ?

Also, what does &arr return to us?

  • 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-26T04:43:16+00:00Added an answer on May 26, 2026 at 4:43 am

    Let’s look at a simple example first:

    int a;
    a = 5;
    

    In a sense the integer a has two values assoicated with it. The one you most
    likely think about first is the rvalue, which in this case is the number 5.
    There is also what is called an lvalue (pronounced “el value”) which is the
    memory address the integer a is located at.

    This is an important concept to grasp. At the end of the day everything is all
    about memory. We store code and variables in memory. The CPU executes
    instructions which are located in memory and it performs actions on data which
    is also in memory. It’s all just memory. Nothing very complicated; if someone
    tries to scare you with pointers don’t listen, it’s all just memory 🙂

    Alrighty so, in the case of an array we are dealing with a contiguious block of
    memory that is used for storing data of the same type:

    int array[] = {0, 1, 1, 2, 3, 5, 8, 13, 21};
    

    As you have already noted the name of the array refers to the memory location of
    the first element in the array (e.g. array == &array[0]). So in my example array
    above &array[2] would refer to the memory location (or lvalue) that contains the
    third element in the array.

    To answer your other question &array is just another memory address, see if
    this code snippet helps clear up what it points to 🙂

    #include <stdio.h>
    #include <stdlib.h>
    
    int array[] = {0, 1, 1, 2, 3, 5, 8, 13, 21};
    
    int main(void) {
        printf("&array[2] is: %p\n", &array[2]);
        printf("&array[0] is: %p\n", &array[0]);
        printf("&array is: %14p\n", &array);
        exit(0);
    }
    
    % gcc test.c
    % ./a.out
    &array[2] is: 0x100001088
    &array[0] is: 0x100001080
    &array is:    0x100001080
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know do there have any way that I can encrypt the array
1-)For sorted array I have used Binary Search. We know that the worst case
I know the question sounds silly, but consider this: I have an array of
I have a simple array: arr = [apples, bananas, coconuts, watermelons] I also have
Suppose we have the Java code: Object arr = Array.newInstance(Array.class, 5); Would that run?
Let's say I have an array, and I know I'm going to be doing
I have an unsorted array of objects. I need to know how I can
As I know, an array needs to have a specific size before compiling time
Okay so you have and array A[]... that is passed to you in some
I have an array of elements. If I do a arr.max I will get

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.