Self referencing structure
I have a structure that contains a pointer to another instance of itself (like a linked list). However I'm getting an error that says I'm missing a ";" when I'm not...
Code:
typedef struct IOD {
char Name[11];
int Request_Type;
char *Transfer_Buffer;
int *Transfer_Counter;
IOD *Next_IOD;
} IOD;
I think I need some sort of prototype struct but I'm unsure how to do this.
Pointer to a structure element
I have a function that expects a int * as a parameter. I have an int inside a structure.
Code:
typedef struct myStruct {
int myStructInt;
} myStruct;
myStruct test_struct;
void test_fun(int * myInt) {
// yadda yadda
}
int main() {
test_fun(??????????);
}
How do I pass the address of the structure element? I tried &(test_struct.myStructInt).