T
TLOlczyk
I have a brain cramp and I need some help.
I have a chunk of code below which demonstrates
a problem I have with multidimensional arrays.
I want to keep it simple but something specific is getting in the way.
int a[10][10];
int b[10][10];
int **present;
int **next;
bool done=false;
while(!done)
{
// Loop which substitutes for complex calculation
for(int i=0;i<10;i++)
for(int j=0;j<10;j++)
next[j]=present[j];
int **temp=next;
next=present;
present=temp;
test_for_done(present);
}
Compare this to the one-dim version ( which works )
int a[10];
int b[10];
int *present;
int *next;
bool done=false;
while(!done)
{
// Loop which substitutes for complex calculation
for(int i=0;i<10;i++)
next=present;
int *temp=next;
next=present;
present=temp;
test_for_done(present);
}
The reply-to email address is (e-mail address removed).
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess,
**
Thaddeus L. Olczyk, PhD
There is a difference between
*thinking* you know something,
and *knowing* you know something.
I have a chunk of code below which demonstrates
a problem I have with multidimensional arrays.
I want to keep it simple but something specific is getting in the way.
int a[10][10];
int b[10][10];
int **present;
int **next;
bool done=false;
while(!done)
{
// Loop which substitutes for complex calculation
for(int i=0;i<10;i++)
for(int j=0;j<10;j++)
next[j]=present[j];
int **temp=next;
next=present;
present=temp;
test_for_done(present);
}
Compare this to the one-dim version ( which works )
int a[10];
int b[10];
int *present;
int *next;
bool done=false;
while(!done)
{
// Loop which substitutes for complex calculation
for(int i=0;i<10;i++)
next=present;
int *temp=next;
next=present;
present=temp;
test_for_done(present);
}
The reply-to email address is (e-mail address removed).
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess,
**
Thaddeus L. Olczyk, PhD
There is a difference between
*thinking* you know something,
and *knowing* you know something.