2d array and a linked list out put

hello i have a project i'm stuck at i'm not really good with C++ so please help me
i did a two 2d array that the user define it size and adds(Both same) the number it hold and adds both numbers or the 2 arrays in a new 2d array, my problem is this :
i need to show the user the 3rd array in a linked list format
i can show it in that for loop but when i told the teacher he said linked list only.
i dont know how.
please help me.
this is the code
1
2
3
4
5
6
7
8
int array3[x][y];
for(int i=0;i<x;i++)             // for Loop of all the elements  [array1+array2]
  {                                 
          for(int j=0;j<y;j++)
          {
                  array3[x][y]=array1[x][y]+array2[x][y];
                  }
                  }

i can post the full code if needed
and thank you

-Bill
I don't understand what you really mean. Are you supposed to be converting these arrays into linked-lists? If you are just supposed to iterate over a linked-list, it goes like this
1
2
3
4
5
6
7
8
9
// !! Pseudo-Code !!
Item it = linked-list.head();
while(it.isValid()){

  //do some stuff

  //goto next element
  it = it.nextInList();
}
Last edited on
thanks for the reply RedX
what i want is a way or a code to display a 2d array but in linked list display format

-Bill
I really don't know what a linked list display format is supposed to be. Sorry.

Maybe something like?

entry 1 -> entry 2 -> entry 3

the project was do today i could not find the answer


thank you very much Redx

-Bill



***** how can you delete a topic?
Last edited on
Topic archived. No new replies allowed.