www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/12/18:30:24

From: iiibanezii AT aol DOT com (IIibanezII)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Binary File Operations
Lines: 24
Message-ID: <1998091222275900.SAA22036@ladder01.news.aol.com>
NNTP-Posting-Host: ladder01.news.aol.com
Date: 12 Sep 1998 22:27:59 GMT
Organization: AOL http://www.aol.com
References: <1998091221320200 DOT RAA14256 AT ladder01 DOT news DOT aol DOT com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I was told my problem was the one fgets argument, but even after fixing it my
programs don't work. Here's the program which reads the binary file.

#include <stdio.h>

int main(void)
{
FILE *test;
char string[100];
int count;

test = fopen("test.dat", "rb");

fread(string, 1, 100, test);
fclose(test);

for(count = 0, count < 100; ++count)
 putchar(string[count]);

return 0;
}


IIibanezII AT aol DOT com

- Raw text -


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