Re: im facing problem with fread()??
- From: Villy Kruse <vek@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 24 Aug 2005 10:54:03 GMT
On 24 Aug 2005 03:30:51 -0700,
manoj1978@xxxxxxxxx <manoj1978@xxxxxxxxx> wrote:
>
> Rajshekhar wrote:
>> Hi ,
>> i am writing a simple prgm to read a .txt file then store the contents
>> into the array...
> Please post the contents of triangle.txt.then someone can help you.
> If triangle.txt is a binary file then try rb instead of r in fopen.
>
The way fread() in program is used strongly suggests that the file has
to be binary. A text file is better read using fscanf(), or a combination
of fgets() and sscanf(), or som variant of getc()/getchar().
Villy
.
- References:
- im facing problem with fread()??
- From: Rajshekhar
- Re: im facing problem with fread()??
- From: manoj1978
- im facing problem with fread()??
- Prev by Date: Re: im facing problem with fread()??
- Next by Date: Re: im facing problem with fread()??
- Previous by thread: Re: im facing problem with fread()??
- Next by thread: Re: im facing problem with fread()??
- Index(es):
Relevant Pages
|