Although don't expect an answer or even a good one.
Also, keep it /prog/ related.
Name:
Anonymous2014-01-20 4:31
I had an idea for a program... I was going to write a quick program that converted units like: ./convert 120 in mm
I planned on having an external text file where I could add definitions like in 2.54 cm cm 10 mm
My intention was not to require the text file to have every possible combination of conversions, but to be able to use multiple conversions in order to get the final conversion. I thought linked lists might be a way to do this. Something like: typedef struct unit { char *name; unit **nodes; double *factors; } unit;
The problem is the linked lists wouldn't really be linear or circular, just arbitrarily linked together with some nodes linking to many others. And what's worse, some linked lists would be completely independent from others (different dimensions). Is there a way to search through linked lists like that without an infinite loop?