M
Matt
Hello. I'm after some general advice. At the moment i have some code
that should run a FOR loop a set number of times. Each time the
structure stamps is read in as follows:
for( i = 0 ; i < stamp_number ; i++ )
{
printf("%g\n",stamps[1].scprod[2]);
....
Now on the first pass when i = 0 the whole loop runs fine. However
onthe 2nd pass, I get a Seg Fault when the printf line above is read.
Now as you can see the value read from stamps is not varying with the
FOR loop parameter but is the same both times, but somehow the second
time the same line is read (when the values in stmaps have not been
altered by the rest of the code) I get a Seg Fault.
Therefore, I'm just after some ideas regarding how this is possible?
Kind Regards,
Matt
that should run a FOR loop a set number of times. Each time the
structure stamps is read in as follows:
for( i = 0 ; i < stamp_number ; i++ )
{
printf("%g\n",stamps[1].scprod[2]);
....
Now on the first pass when i = 0 the whole loop runs fine. However
onthe 2nd pass, I get a Seg Fault when the printf line above is read.
Now as you can see the value read from stamps is not varying with the
FOR loop parameter but is the same both times, but somehow the second
time the same line is read (when the values in stmaps have not been
altered by the rest of the code) I get a Seg Fault.
Therefore, I'm just after some ideas regarding how this is possible?
Kind Regards,
Matt