www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/25/09:11:20

From: chris_mears AT softhome DOT net (Chris Mears)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: URGENT!!! Please (A Little Long)
Organization: CHOAM
Message-ID: <3817395f.2980548@news.bigpond.com>
References: <3813e85f DOT 18243975 AT news DOT pasteur DOT dialix DOT com DOT au> <004aa0e3 DOT faebcda4 AT usw-ex0101-006 DOT remarq DOT com> <381434da DOT 7867638 AT news DOT pasteur DOT dialix DOT com DOT au>
X-Newsreader: Forte Agent 1.5/32.452
MIME-Version: 1.0
Lines: 30
Date: Mon, 25 Oct 1999 11:06:15 GMT
NNTP-Posting-Host: 139.134.193.190
X-Trace: newsfeeds.bigpond.com 940849325 139.134.193.190 (Mon, 25 Oct 1999 21:02:05 EST)
NNTP-Posting-Date: Mon, 25 Oct 1999 21:02:05 EST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Mon, 25 Oct 1999 10:56:59 GMT, kezman AT nOsPaMbigfoot DOT com (Kieran
Farrell) wrote:

[snip]

>
>The above wont work, cause whatever pointer is assigned to fp is lost
>when the OpenFile procedure is finished.
>
>OK I'll try showing my quick fix again, hopefully it makes more sense
>and should compile this time.
>
>int main(void)
>{
>    FILE *fp;
>    
>    fp = OpenFile(fp);
>    return;
>}
>
>FILE *OpenFile(FILE *fp)
>{
>    fp = fopen('a:\\yadayad.txt", "wb");
>    return fp;
>}
>

Why pass 'fp' as a parameter if you are going to change it in the
first line of the function?

- Raw text -


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