i have this structure :

typedef struct nodetag{
	char *employeeNumber;
	name mName;
	birthday bday;
	char *address;
	char *rank;
	int salary;
	hireDate *hdate;
typedef struct nodetag1{

	char *month;
	char *date;
	char *year;

but I don't know how to access the month in bday. i tried using node1->bday->month but had an error. I malloced using node1 = (node)malloc(sizeof(struct nodetag));

please help, anyone?

why are the members of birthday char* instead of int? But to answer your question

node1->bday.month = malloc(32); // allocate space for 32 characters

but if you mande them integers

node1->bday.month = 0; // January

thank you very much! I used string because I have to scan each character from a textfile to get the data I need to use.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.