A
Alan
Hi, I m working on thesis on mechanical engieering. I m using C to
solve a particualr problem.
I have this code underneath which is giving me problems:
for (t=0;t<=maxt;t++){
printf("testing loop\n");
for (x=0;x<=maxx;x++){
for(y=0;y<=maxy;y++){
printf(".");
if (x==0){
printf("hello");
tp[t][x][y]=tp[t-1][x+1][y]; //Problem here
}
}}}
I simplified as much as possible.
the problem is at the indicated line.
tp is a 3 dimensional array, allocated using calloc().
Im filling array with some values.
When the program arrives at this line, it exits and prints only one "."
and one "hello".
But without this line, it prints "." and "hello" according to the loop
iterations.
Can anhybody indetify the problem please ?
Im using Lcc win as a compiler and the array is a pointer to pointer to
pointer i.e. --> double ***tp
Thanks!!!
Alan
solve a particualr problem.
I have this code underneath which is giving me problems:
for (t=0;t<=maxt;t++){
printf("testing loop\n");
for (x=0;x<=maxx;x++){
for(y=0;y<=maxy;y++){
printf(".");
if (x==0){
printf("hello");
tp[t][x][y]=tp[t-1][x+1][y]; //Problem here
}
}}}
I simplified as much as possible.
the problem is at the indicated line.
tp is a 3 dimensional array, allocated using calloc().
Im filling array with some values.
When the program arrives at this line, it exits and prints only one "."
and one "hello".
But without this line, it prints "." and "hello" according to the loop
iterations.
Can anhybody indetify the problem please ?
Im using Lcc win as a compiler and the array is a pointer to pointer to
pointer i.e. --> double ***tp
Thanks!!!
Alan