Path: utzoo!attcan!uunet!lll-winken!ames!pasteur!ucbvax!techunix.BITNET!ssreefc From: ssreefc@techunix.BITNET (florin coter) Newsgroups: comp.lang.c Subject: malloc & tc. Keywords: malloc, turboc Message-ID: <8283@techunix.BITNET> Date: 11 May 89 06:08:17 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: Technion - Israel Inst. Tech., Haifa Israel Lines: 38 hello world, this is a second posting about malloc. thanks to all who answered. from the answers i got it is clear to me that it was some missunderstanding. i'll try this time to be clearer. THE CODE: .... extern char a[1000][50]; /* !!! */ main() { char *malloc(), *p; if( ( *p=malloc( (unsigned)30000 ) ) == NULL ) puuts( "no space" ); ... } ... i use turboC 1.5. in TINY model all one can get is 64K (code, data,...). from the above it is more than obvious that the request of 30K of space cannot be satisfied. still malloc does not complain and i get data written over data. the above is still true for SMALL model where you get 64K for all data which is more than 64K. still no complain from malloc. i use microsoft C 3.1. small model is the same as tc and the program behaves the same way. WHYYYYYYYYYYYYYYYYYYYY ??????????????????????? florin. -------- Florin Coter ssreefc@techunix Home address: 40/37 Leon Blum St., Haifa, Israel. Home phone: 04-386133. Office address: Solid State Institute, Technion, Haifa 3200, Israel. Office phone: 04-293938/293613/293615.