-
linked list error
i have a defined a struct that looks like this:
//code:
struct record
{
char name[25];
char address[80];
int yearofbirth;
char telno[15];
};
//endcode
i am trying to create a linked list of records, and am unable to allocate memory on the heap for the list.
this line of code is giving me some divine errors:
//code:
record *start;
start = malloc(sizeof(record));
//endcode
the error says this:
cannot assign void* to record*
i know what this means, but i have no idea how to remedy the problem.
does anyone have some input so that i can finally get some rest today???
-
start = (record *) malloc (sizeof (record));
-
oh my.
oh my, that error disappearing was the best rabbit that a magician could pull out of their hat....
...thank you so very much...i will a wonderful two hours of sleep tonight...if i can get the rest of the list to function correctly...
*sigh*