Well, I think C is fun!
> wondering if anyone out there had any header files, libraries or whatever
> to make implementation of linked lists a little easier (else I'll have to
> use Eiffel instead...!), or if anyone can point me in the right direction.
I've never used macros or libraries for linked lists. What are you
trying to do?
Off the cuff:
/* Header */
typedef struct item
{
struct item *next;
/* Data here */
} item;
static item list = (item *) 0;
/* To add an item pointed to by new... */
new->next = (item *) 0;
if (!list)
list = new;
else
{
item *cur = list;
while (cur->next)
cur = cur->next;
cur->next = new;
}
/* To pop the first item */
item *cur = list;
list = list->next;
cur->next = (item *) 0;
return (cur);
/* To run each item in the list through a
particular process... */
item *cur = list;
while (cur)
{
process(cur);
cur = cur->next;
}
/* To pop the item following the one pointed
to by thing */
item *ret = thing->next;
if (thing->next)
thing->next = thing->next->next;
if (ret)
ret->next = (item *) 0;
/* And so on. Linked list manipulations can usually be
trivially expressed in C - until you start playing with
doubly linked lists (which aren't MUCH harder) etc. */
> While I'm asking, does anyone out there have/know where I can find,
> suitable utilities, shareware compilers, API's for Windows programming in C?
> I have considered purchasing the Borland C++ v4.0 compiler, but at $200
> (academic discount) it is still a little pricey (not to mention that I've
> heard it is buggy?...).
A C compiler with Windows API wouldn't work at all if it wasn't buggy :-)