Passing Structure by Reference
Okay, so this is how I declared my structure
Code:
typedef struct { // This is global
int UserNum;
char User[31];
char Pass[31];
char Role[14];
} DATATYPE_Login;
int main () {
DATATYPE_Login STRUCT_Login; // This is inside main fxn
...
}
I have functions that use the structure as a parameter. I'm using a pointer because in this way, I can edit the actual fields of the parameter (rather than edit only a copy). I declared them like this:
Code:
int TXTDATA_Read_Rates(DATATYPE_Rates *STRUCT_Rates) {
...
}
But upon compilation, I get these kinds of error messages:
Code:
request for member ‘User’ in something not a structure or union
If I remove the asterisks, it compiles, but I'm not getting to save the values into the struct fields.
Help?