I'm trying to write some code that will take each individual part of a 2D array and put it into the same part of a different array. Here's the code, tell me what you think!! ^_^ Thanks in advance for any help!!
bool repeat = true;
int a = 0;
int b = 0;
char array1[10][10];
char array2[10][10];
while (repeat == true)
{
if (a < 10)
{
if (b < 10)
{
array1[a][b] = array2[a][b];
b = b + 1;
// I'v compiled this with a cout << a << b; right here and it always says that a is
// 0 and that b is 1 at this point
if (b == 10)
{
b = 0;
a = a + 1;
}
}
if (a == 10)
{
repeat = false;
}
}
}
Sorry, if this seems incomplete, it's from a function in another program. Please help me if you have any idea why this doesn't work!! Thanks ^_^!!