Mail Archives: djgpp/1999/07/20/04:55:28
Paul J G wrote:
: Many thanks to everybody, everythings running fine now. Although
: could be so kind as to answer these questions for me.
: 1) How would I use the free command to free up one of the shape
: or to delete
: the whole structure ?.
You shaould call free once for every item malloc'ed.
void freemyshape(int shapeno)
if(shape[shapeno].xpoint != NULL) free(shape[shapeno].xpoint);
if(shape[shapeno].ypoint != NULL) free(shape[shapeno].ypoint);
assuming is global otherwise you'll have to pass the shape to
: 2) Both Michael and Ed used slightly different malloc commands, whats
: difference ?.
Michael was casting the return of malloc, which is a bad idea in C I
he was writing in C++.
: 3) If I am writing for a machine with 32 megs and want to use, say 3
: for holding my shape data in would I use FARMALLOC command instead ?.
no malloc should suit you fine. DJGPP is good like that.
- Raw text -