[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: File input problem



Ashwin forced the electrons to say:
>   for( int j = 0; j < i; ++j )

Make that j < i - 1 and you should be fine. 

Maybe that is wrong. I am using my C concepts here (assuming infile.good()
method equivalent to the stdio function feof()).

> <test.txt contents>
> linux
> <test.txt contains *only* five characters>

six, my friend, there is a newline at the end.

Binand

-- 
#define l/* Binand Raj S. <binand@xxxxxxxxxxxxxxxxxxxxx> */".%\"-\"("
#define s/* Ambition: To write sendmail.cf from scratch  */abs(abs(i)-5)
main(i,j){for(i=-5;i<6;i++){for(j=0;j<35-s;j++,putchar(32));putchar(s[l]^
108);for(j=0;j<2*s-1;j++,putchar(32));s&&putchar(s[l]^108);putchar(10);}}