M
Michel Rouzic
It's the first time I try using structs, and I'm getting confused with
it and can't make it work properly
I firstly define the structure by this : typedef struct { char *l1; int
*l2; int Nval; } *arrays;
It's supposed to be a structure containing an array of chars, an array
of ints and an int.
I declare functions like this : arrays *parseline(char *line, int N)
and I point to the arrays I want to return like this :
out.l1=displayln;
out.l2=sumline;
out.Nval=Nval;
return out;
When compiling it gives me an error, such as "error: request of member
<< l1 >> in something that's not a structure or an union". What's wrong
with the way I do it and how should I fix it?
it and can't make it work properly
I firstly define the structure by this : typedef struct { char *l1; int
*l2; int Nval; } *arrays;
It's supposed to be a structure containing an array of chars, an array
of ints and an int.
I declare functions like this : arrays *parseline(char *line, int N)
and I point to the arrays I want to return like this :
out.l1=displayln;
out.l2=sumline;
out.Nval=Nval;
return out;
When compiling it gives me an error, such as "error: request of member
<< l1 >> in something that's not a structure or an union". What's wrong
with the way I do it and how should I fix it?