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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:24:53+00:00 2026-06-15T02:24:53+00:00

Possible Duplicate: How do I use arrays in C++? In the following code snippet:

  • 0

Possible Duplicate:
How do I use arrays in C++?

In the following code snippet:

int a[2][3][2]={{{1,2},{9,8},{3,7}},{{2,2},{1,4},{5,4}}};

what will be the answers for a[i],a[i][j] ,where i<=1 and j<=2
I have no problem in understanding the a[i][j][k] working.Can you please explain how does the above indexing works?

  • 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-15T02:24:54+00:00Added an answer on June 15, 2026 at 2:24 am

    The thing you have to remember here is that the there are 2 different objects you are working with.

    a[i][j][k]
    

    and

    a[i][j], a[i] and a
    

    The first is an int, the other 3 are pointers

    The associated memory’s look like this:

    a       : | a[0] | a[1]|
                 \/     \______________________
    a[]     : | a[0][0] | a[0][1] | a[0][2] | a[1][0] | a[1][1] | a[1][2] |
                 \/         \______________
    a[][]   : | a[0][0][0] | a[0][0][1] | a[0][1][0] | a[0][1][1] | ...
    

    And so on…

    Now in the example you make you do arithmic operations with pointers eg. a[1] - a[0] = 3. If you look at the memory associated wit that you can see there are 3 memory locations between the 2 pointers, thus the result is 3.

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

Sidebar

Related Questions

Possible Duplicate: How do I use arrays in C++? I have the following C
Possible Duplicate: How do I use arrays in C++? I have no idea how
Possible Duplicate: Negative array indexes in C? Can I use negative indices in arrays?
Possible Duplicate: I have an array of integers, how do I use each one
Possible Duplicate: Can we use any other TAG inside <ul> along with <li>? Or
Possible Duplicate: How to use include within a function? i have two file inc.php
Possible Duplicate: c++ multithread I use c++ to implement a thread class. The code
Possible Duplicate: How do I use arrays in C++? I am not sure if
Possible Duplicate: Can I use operators as function callback in PHP? Is it possible
Possible Duplicate: Comparing Arrays in C# I have a two string arrays: string[] a;

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.