to the guy who had the problem with bool (Mux0x0):
my guess is your library probably is old (i'm not sure if Standard C-99 has the bool data type), and maybe contains a line like this:
enum bool { false = 0, true };
and it conflicts with the builtin bool datatype. you might get away with renaming your source files so they have the extension '.c' (lowercase) if you have access to the library sources.
to Jan:
i guess you're implementing a linked list. in that case, you'd want to allocate each item separately, and then queue them like this:
struct list * item_first = malloc(sizeof(struct list));
struct list * item_next = malloc(sizeof(struct list));
item_first->next = item_next;
that way, you'll have clean pointers to all your allocated objects, instead of having to do something like this:
item_first->next->next = malloc(sizeof(struct list));
or so i think, anyway.
and you'll need to deallocate each struct separately, so i think my method is better (if you don't have another pointer to the allocated data, you might end up with memory leaks).
---------------------------------
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your freeaccount today. |