• C

Lists

I have a list of clients (name, adress, phone)and I want to have another list called bills (code, ammount). Each client may have more than one bill.How can I link them together, in a way that I can at anytime know how big is the debt of a client (in money) and how many bills he has( just by typing the name and the program shows me the list off bills)?
vitormnsdiasAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnondCommented:
How about making a linked list of clients of structs like this:

struct client {
char name[NAME_SIZE];
char address[ADDRESS_SIZE];
/* add any other client info */
struct bill* bill_list; /* pointer to list */
}

and each client (using the bill_list pointer) has a list of bills of structs like this:

struct bill {
int ammount;
/* add any other bill info */
struct bill* next;
}

don't forget to have all the needed function to menage the lists (add, remove etc.)

This is a starting point from which you should be able to continue yourself.
If this is homework, we aren't supposed to help you but can give some guidenss.

Good luck,
Arnon David.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jhanceCommented:
Have you thought about using QuickBooks?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.