M
Michael
Hello everyone here,
I've got a question according to a C program,
but I'm not sure if this one is "off-topic".
So, its a program using two structures each containing
an array (a.array1[][] b.array2[][])
Both arrays are of type double and of size 2x11.
I access the structs via pointers (p_a, p_b).
If I use
p_a->array1[0][0] = 3.0
in
p_b->array2[0][2]
the value also changes to 3.0. The first attemp I made
was invoking gdb and look for the addresses of both
arrays:
its 0x401020 (gdb> p &(p_a->array1[0][0]) )
and 0x400020 (gdb> p &(p_b->array2[0][2]) ).
But somehow they are linked to each other. Even if I
change the value of the variable within the debugger
I effect both arrays.
As I said it may be not the right newsgroup, but the program
is written in C and maybe you've got some hints to solve
or tackle this problem.
Thanks,
Michael
I've got a question according to a C program,
but I'm not sure if this one is "off-topic".
So, its a program using two structures each containing
an array (a.array1[][] b.array2[][])
Both arrays are of type double and of size 2x11.
I access the structs via pointers (p_a, p_b).
If I use
p_a->array1[0][0] = 3.0
in
p_b->array2[0][2]
the value also changes to 3.0. The first attemp I made
was invoking gdb and look for the addresses of both
arrays:
its 0x401020 (gdb> p &(p_a->array1[0][0]) )
and 0x400020 (gdb> p &(p_b->array2[0][2]) ).
But somehow they are linked to each other. Even if I
change the value of the variable within the debugger
I effect both arrays.
As I said it may be not the right newsgroup, but the program
is written in C and maybe you've got some hints to solve
or tackle this problem.
Thanks,
Michael