From: "A. Sinan Unur" Newsgroups: comp.os.msdos.djgpp Subject: Re: problem with malloc and free Date: 15 Dec 2002 16:03:46 GMT Organization: Cornell University Lines: 32 Sender: asu1 AT cornell DOT invalid (on pool-141-149-207-242.syr.east.verizon.net) Message-ID: References: <000001c2a37a$59f41060$186a10ac AT citechbd DOT com> <3277-Sun15Dec2002000831+0200-eliz AT is DOT elta DOT co DOT il> NNTP-Posting-Host: pool-141-149-207-242.syr.east.verizon.net X-Trace: news01.cit.cornell.edu 1039968226 19453 141.149.207.242 (15 Dec 2002 16:03:46 GMT) X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu NNTP-Posting-Date: 15 Dec 2002 16:03:46 GMT User-Agent: Xnews/5.04.25 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Lars O. Hansen" wrote in news:athc08$l6d$1 AT news DOT online DOT de: > ok, hopefully this is it. *thanks*. ... Yes it might have been this. > :-) > > > So, I did sth. like > > int *a=malloc(sizeof(int)*360); > > then I can access the 360th int element by > > a[359] ? Yes. a is a pointer to int. a + 1 points to the next int. > A question (to Eli): after i corrected that mistake and compiled for > the first time and run the program, it crashed again. then i compiled > again and it didn't crash. then I compiled many more times to make > sure and it didn't crash. I am working in A DOS box under Win 98. > Could there be some sort of caching "issue" which makes djgpp use the > not just saved file or WIndows to execute the not new compiled version > but the old one ? no. -- A. Sinan Unur asu1 AT c-o-r-n-e-l-l DOT edu Remove dashes for address Spam bait: mailto:uce AT ftc DOT gov