B
Bart Vandewoestyne
Going through someone else's code, i came across the following:
typedef struct {
...
double *local_Cp;
...
double **localC;
...
} MediaInfo;
...
MediaInfo *media = <some-initialization>;
media->localC = media->local_Cp;
gcc gives me a warning:
warning: assignment from incompatible pointer type
Coming from the Fortran 95 world, I'm not too familiar with pointers yet...
but I think the original author of the code made a mistake here, and it
should probably be fixed as
media->localC = &(media->local_Cp);
Am I correct? Or could the way the original author has written the code be
really intentional?
Thanks,
Bart
typedef struct {
...
double *local_Cp;
...
double **localC;
...
} MediaInfo;
...
MediaInfo *media = <some-initialization>;
media->localC = media->local_Cp;
gcc gives me a warning:
warning: assignment from incompatible pointer type
Coming from the Fortran 95 world, I'm not too familiar with pointers yet...
but I think the original author of the code made a mistake here, and it
should probably be fixed as
media->localC = &(media->local_Cp);
Am I correct? Or could the way the original author has written the code be
really intentional?
Thanks,
Bart