Hi all!!
I have a problem. I have to write a program that initialises a 2 dimensional arrayof double and uses a function to copy the sub-arrays of this 2 dimensional function one-by-one in to a seperate array.
please help. ive spent all day on this and wrote so many variations.
I can copy a 2 dimensional array within the main function, like so...
#include <stdio.h>
#define SIZEA 2
#define SIZEB 4
Code:
main()
{
int i, j;
double destination2[SIZEA][SIZEB];
double source[SIZEA][SIZEB]=
{
{5, 3, 6, 7},
{3, 15, 12, 4}
};
for(i=0; i<SIZEA; i++)
{
for(j=0; j<SIZEB; j++)
{
destination2[i][j]= source[i][j];
printf("%.2f\n", destination2 [i][j]);
}
printf("\n");
}
}
but this isnt what the question asks for and im really stuck.
Thanks in advance
Stuart