Re: stream io in c
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Wed, 30 Jul 2008 22:21:01 -0400
Ron Ford wrote:
.... snip ...
I've tried some variations with this.
int i;
for (i = 0; i <= UCHAR_MAX; i++) putchar (i);
When stdout is redirected to a file, I get a file of size 257
bytes. I wanted to see if that would also be the case if I
created the file from source, but I've got type mismatches here:
The system you are using affects this. Some will expand '\n' to cr
and lf, others just to lf, others to just cr, or even a line with a
length flag. Some will insist on adding an EOF marker, some wont.
If your system is ASCII you wrote a '\n' with the 11th character.
You wrote a '\0' with the first.
What you ARE guaranteed is that you get back what you wrote
(assuming proper file modes in the open argument).
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
.
- Follow-Ups:
- Re: stream io in c
- From: Keith Thompson
- Re: stream io in c
- References:
- stream io in c
- From: Ron Ford
- Re: stream io in c
- From: Ron Ford
- stream io in c
- Prev by Date: Re: stream io in c
- Next by Date: Re: [BC] C tutorial q4
- Previous by thread: Re: stream io in c
- Next by thread: Re: stream io in c
- Index(es):
Relevant Pages
|