Hi,
I have a matrix held in a text file, and I want it to go into a array of structs, but I can't seem to do it directly:
take my struct first.
Code:
struct xmatst { double ev; int ei;};
struct xmatst *in;
one of the simpler ones :-)
but. in order to get my values from my textfile into that ev member, I need to create another array of doubles called tmpin and do the usual:
f
Code:
or(i = 0; i < N; i++)
for(j = 0; j < N; j++) {
fscanf(fp, "%lf", &tmpin[i*N+j]);
And then I need to assign the tmpin values to my "real" array in. I tired to not use tmpin, and in the above assignment I used but that gave me an "invalid type argument of ->" error, though I thought that was the way you referenced a pointer to a struct member.
May be the fact that it's an array of structs changes things. If I have to do things this way in C it'll be slower than perl. :-)