I want to make a sub list in a single list using c. I have a list with name, surname, phone, e-mail…. I want to make a sub list under phone to keep more phones. This is my struct:
typedef struct ph{
char * phone;
ph *next;
}listofphones;
typedef struct client{
char* name;
char* surname;
date birthday;
char bankaccount[16];
listofphone phone;
char* mail;
struct client *next;
} clientData;
I want an extra sub-list for any client. The problem is that the phones are all in the same list. So how can I create a different list?
Example:
name1->surname1->birthday1->bankaccount1->phone1->mail1.......
|
phone2
|
phone3
.
.
.
(Sorry for bad drawing I hope it’s clear enough.)