I have following structure
typedef struct List_Node {
struct File_Descriptor *data;
char *key;
struct List_Node *next;
}List_Node;
Now I inserted some values into the both the structures and want to access the data of type File_descriptor. How to do this?
I tried this
struct List_Node *ln1;
printf("%s", ln1.File_Descriptor->data);
but it is giving error
error: request for member ‘error: File_Descriptor’ in something not a structure or union`
You just want:
struct File_Descriptoris the type.datais the struct member name.Also though the
printfformat looks entirely wrong. Not sure what you’re trying to do there.%sis string, anddatacertainly doesn’t look like a string.