As part of my program, I have defined and initialized a structure. But when I compile it, gcc gives me the following error on all the initialization " initializer element is not constant". Anyone know why this is the case?
struct RECORD
{
char* username;
char* password;
char* type;
struct RECORD *next;
};
struct RECORD *head=(struct RECORD*)malloc(sizeof(struct RECORD));
struct RECORD *temp=(struct RECORD*)malloc(sizeof(struct RECORD));
struct RECORD *linktemp=(struct RECORD*)malloc(sizeof(struct RECORD));
struct RECORD *pos=(struct RECORD*)malloc(sizeof(struct RECORD));
I get an error on code lines 9-12.