delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/04/11:32:35

Message-ID: <19991004150601.9857.rocketmail@web1401.mail.yahoo.com>
Date: Mon, 4 Oct 1999 08:06:01 -0700 (PDT)
From: Prashant TR <prashant_news AT yahoo DOT com>
Subject: Re: BASIC : how to open a file?
To: djgpp AT delorie DOT com
Cc: fiammy AT my-deja DOT com
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com


--- fiammy AT my-deja DOT com wrote:
> Could you give me an outline of a routine that loads
> a file (in DOS),
> and returns a pointer to the structure in which you
> read the file?
> 

int main()
{
 FILE *fp;

 if ((fp = fopen("foo", "rb")) == NULL) {
  printf("Error: unable to open\n");
  return (0x7f);
 }

 // Read from file here. The file pointer is in fp.
 // Use fread function.

 fclose(fp);
 return 0;
}


=====

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

- Raw text -


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