0

I just got a program that does forward substitution. It is working fine but I would like to make it so the user can enter size of both 2D n x n array and a n x 1 array and then be able to enter the elements of the arrays. Since the 2D array is square and 1D array shares the same row size, only one number would need to be entered.

ie: Enter size of array: 4

Enter elements of 2D array of size 4 x 4: {1,2,2,5}.....

Enter elements of 1D array of size 4: {1,2,....

How can I do this? I read something about 'new' but don't understand it well.

Also, I have the 2D array being passed to functions where

`void print2array(double intarray[][4], int lim)`

Is it possible to have the intarray[][n]? Where n is the number entered above?