for learning c i have copied a simple program about linear lists.
but i am getting in both dev c++ and codeblocks compile error at line
malloc(sizeof(struct angestellt))) == NULL) {
fprintf(stderr, "no memory available"
"fuer anfang\n");
i am wondering a lot about this, because i have the sample from educational book?
file is attached
It seems like that they have forgotten to make a cast.
(
anfang = (struct angestellt *) malloc(sizeof(struct angestellt))
)
== NULL
etc.
Maybe their compiler had made a cast automatically, but mine (nor G++ or GCC either) does not automatically cast malloc result from void * to desired pointer.
$10 USD in 0 day
5.0 (1 review)
1.1
1.1
3 freelancers are bidding on average $15 USD for this job