delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/12/15/11:15:23

From: "A. Sinan Unur" <asu1 AT c-o-r-n-e-l-l DOT edu>
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: <Xns92E5708B31033asu1cornelledu@132.236.56.8>
References: <000001c2a37a$59f41060$186a10ac AT citechbd DOT com> <atfimi$1fk$1 AT news DOT online DOT de> <atfirg$1j4$1 AT news DOT online DOT de> <3277-Sun15Dec2002000831+0200-eliz AT is DOT elta DOT co DOT il> <Xns92E4AF8D3E4E2asu1cornelledu AT 132 DOT 236 DOT 56 DOT 8> <athc08$l6d$1 AT news DOT online DOT de>
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" <lars DOT o DOT hansen AT gmx DOT de> 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019