can i do a multi-dimensional arrays like this?

i am totally lousy in programming i was trying to do a multidimensional arrays with 8X8 like this and - the value of 128.

#include <iostream>
using namespace std;

void original_block()
{
int a[8][8];
int first;
*(a+0)[0] = first;
int second;
*(a+0)[1] = second;
int third;
*(a+0)[2] = third;

cout << "enter value" << endl;
cin >> first;
cin >> second;
cin >> third;
cout << first << " " << second << " " << third << endl;

}

int main ()
{

original_block ();



return 0;
}


I think your assignment is backwards, always remember it's right to left. Kinda hard to tell what your code is trying to do. Can you explain what you are trying to achieve in english like solution?

eg.
first = 1+1; --< correct first is 2.

1+1 = first <<< not so correct.


right is the value, left is what your assigning the value to.
Last edited on
sorry I just got it, the array is named a... are you getting errors or you just want to know if this is correct?
Last edited on
yes is working but i am trying to do an multidimensional arrays with 8X8 and minus the 8X8 arrays with value of 128.
Last edited on
*(*(a+0) + 0) - first
*(*(a+0) + 1) - second
...
*(*(a+1) + 0) - ninth
Last edited on
Topic archived. No new replies allowed.