I'm using visual studio to write a c code.
This is the malloc code line i was told to use:
root = (Coor)malloc(sizeof(Coor));
It doesn't let me use it for the following error:
identifier not found
Can anyone tell me why it happens and how to fix it?
Thanks,
sizeof(Coor)
bytes and then converting the result toCoor
makes no sense whatsoever. Either convert toCoor *
or allocatesizeof <derefernced Coor>
(ofCoor
is a pointer type). Moreover, casting the result ofmalloc
in C can only hide erros, but serves no other meaningful purpose.