I have my code working except for formatting it to print the array as a 10x10 table
I can't seem to figure out how to make it like that but I had been told that it would be easier copying the 1d array to a 2d array then printing it.
any way though would work
any suggestions on it would be great.
If you are able to copy the array to a 2D array you would be able to print it by printing instead of copying it.
Here is a simple demo, maybe you can adjust it.
I think this is what you are asking? The trouble is that 0%N is 0. Because of this you have to shift your modulo to get clean printing. If you wanted 5 on a row, that gives you 1,2,3,4,5*
and 5%5 = 0. Then you get 6,7,8,8,10 and 10%5 =0 again. So for a 1-d array printed as a 2-d array you just want:
for(i =1; i <= max; i++)
{
cout << array[i-1]; //add your favorite spaces, commas, or the like
if(i% rowlength == 0)
cout << endl;
}