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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:50:37+00:00 2026-06-11T02:50:37+00:00

int a[10][5]; for (int i = 0; i < 10; i++) { for (int

  • 0
int a[10][5];
for (int i = 0; i < 10; i++)
{
    for (int j = 0; j < 10; j++)
    {
        cout << i[j[a]];
        cout << j[i[a]];
    }
}  

Edit:assume the values are already initialized to the array and is this cout valid then?

please explain the i[j[a]]; part only regardless of the program I’m concerned about that statement only!

  • 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-11T02:50:39+00:00Added an answer on June 11, 2026 at 2:50 am

    C arrays have a strange quirk that allows them to be accessed through the “opposite” direction. This is deeply rooted in the pointer arithmetic of arrays. For example, a[1] is equivalent to *(a + 1). Likewise, 1[a] is equivalent to *(1 + a). Due to the commutative nature of addition, this works out quite nicely. More details can be found here.

    With that knowledge in tact, the expression i[j[a]] can be broken down into two different parts. j[a] is equivalent to *(j + a) which would return another array due to the multi-dimensional nature of the array you have, for example purposes we’ll call this returned array p. Then you have the statement i[p] which would be equivalent to *(i + p). Bringing it back all together would show you that i[j[a]] is equivalent to *(i + *(j + a)). Indeed, this means that i[j[a]] is just an obfuscated way of writing a[j][i].

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

Sidebar

Related Questions

I wrote this small C++ program and built it(Release) #include<iostream> int main(){ std::cout<<Hello World;
#include <iostream> using namespace std; int main() { cout << !!!Hello World!!! << endl;
I have the following code: Some functions: A::A(int i_a) {cout<<int Ctor\n;} //conversion constructor void
I created a program called test: #include<stdlib.h> #include<iostream> int main() { std::cout<<system(..\\add\\debug\\add.exe 4 8);
int main() { char* NamePointer = new char; std::cout << Enter the file you
int main() { int b[2][3]={{1,2},{3,4,5}}; cout << b[0][2] << endl; } And the result
class test { public: int data; test(int var = 0):data(var){cout<<constructor<<endl;} ~test(){ cout<<destructor<<endl; } test(const
A simple test app: cout << new int[0] << endl; outputs: 0x876c0b8 So it
void myterminate () { cout << "terminate handler called"; } int main (void) {
for(;;) { int rand_number = rand() % 2; cout << rand_number; } These loops

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.