Hi,
I'm getting the error:
error: invalid lvalue in unary `&'
from lines '//*' when compiling:
-----------------------
#include <stdio.h>
#include <string.h>
#include <rpc/rpc.h>
int f(void)
{
int x,y,s;
FILE *outfile;
XDR xdrs;
char filename[]="\0";
lba_MakeFilename(filename,"chkpt","xdr",nt);
outfile = fopen(filename, "w");
//Set up an XDR stream
xdrstdio_create(&xdrs, outfile, XDR_DECODE);
for(x=1; x<=(par->nx); x++) {
for(y=1; y<=(par->ny); y++) {
for(s=0; s<nvecs; s++) {
xdr_float(&xdrs, &((float)N[x][y].n_r[s])); //*
xdr_float(&xdrs, &((float)N[x][y].n_b[s])); //*
xdr_float(&xdrs, &((float)N[x][y].n_s[s])); //*
}
for(s=0; s<dim; s++) {
xdr_float(&xdrs, &((float)N[x][y].d[s])); //*
}
xdr_int(&xdrs, &(N[x][y].wall_state));
}
}
}
xdr_destroy(&xdrs);
fclose(outfile);
return 0;
}
------------------
where in my code I also #include'd header files defining relevant vars
and functions.
I've used this construct before in another code of mine without probs.
Any clues?
Many thanks!
Neil.