G
gc
I noticed that when f2c converts a fortran subroutine to a c function
it decrements the pointer sent as an argument to the function and then
uses 1 based addressing system. If am I not wrong, one can increment
a pointer to one past the end of the array but not reference it. But
does a similar rule hold for one before the beggining of an array?
I am currently using an array larger than the required size by one and
sending array+1 as to the function just to be safe i.e., instead of
double a[]={1.,2.,3.};
f(a);
I am doing
double a[]={/*some junk*/-1.,1.,2.,3.};
f(a+1);
but is it really necessary?
it decrements the pointer sent as an argument to the function and then
uses 1 based addressing system. If am I not wrong, one can increment
a pointer to one past the end of the array but not reference it. But
does a similar rule hold for one before the beggining of an array?
I am currently using an array larger than the required size by one and
sending array+1 as to the function just to be safe i.e., instead of
double a[]={1.,2.,3.};
f(a);
I am doing
double a[]={/*some junk*/-1.,1.,2.,3.};
f(a+1);
but is it really necessary?