From: eds AT gravi DOT physik DOT uni-jena DOT de (E. Schmidt) Newsgroups: comp.os.msdos.djgpp Subject: Simple beginner questions Date: 3 Dec 1997 19:32:12 GMT Organization: Friedrich-Schiller-University Jena, Germany Lines: 29 Message-ID: <664c3s$2rq$1@fsuj19.rz.uni-jena.de> NNTP-Posting-Host: hpxs2.tpi.uni-jena.de To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hallo World! 1. How to define user function with variable number of arguments? I simply want(ed) to define my error handler printing some formatted message and making some other things like closing files... 2. How to close the file, if I don't know if it is opened or closed? Only file variable FILE * fp; is achivable. 3. Is it important in C to free the memory in the inverse allocation order ? p1=malloc(100); p2=malloc(200); ... free(p2); free(p1); What happens with pieces of memory which are set free in "wrong" order? For above example free(p1); p1=malloc(50); Would these 50 bytes be allocated in the memory of previous malloc(100) ? Thanks a lot Eduard