dear smart folks, sorry if this is a trivial question.
I am trying (in MSVC++ but its a C not C++ program)
to pass a 1D array of structures to a function by "reference" (not value, I want the function to be able to change values).
the structure is typedeffed (outside main) using defined constants (but ultimately I will want to malloc its size which may cause problems again)
[code]
typedef struct
{
int cc;
float geno[MAXLOCI], *covar, score;
} DATAtype;
[\code]
and declared as an array
[code]
DATAtype orig[MAX_PATTERNS]
[\code]
and I call the function PermP
[code]
double PermP(INPUTtype inputs, float tval , DATAtype *orig, DATAtype *permed,int pteston, NNET2type Net, float *totsqerr, int *index, PATTERNtype InPatterns,PATTERNtype OutPattern);
[\code]
with the call
[code]
ppval=PermP(inputs,tval,&orig, ....
[\code]
now I thought to pass by ref passing an address and receiving as a pointer to DATAtyoe was correct.
this link http://www.iota-six.co.uk/c/33_struc_s.htm seems to say so.
but there seems to be some confusion over passing a structure or an array of structures that I can't resolve as I get a warning error in MSVC++
c:\snpnet\netcall.c(746) : warning C4024: 'PermP' : different types for formal and actual parameter 3
c:\snpnet\netcall.c(746) : warning C4047: 'function' : 'struct DATAtype *' differs in levels of indirection from 'struct DATAtype (*)[1000]'
the 1000 refers to MAX_PATTERNS.
by the way the program seems to work fine !!! but I'm keen to sort this error before I change it to use malloc.
sorry its a long tedious query
many many thanks in advance for any advice (and thanks for your help on a couple of previous occasions too)