Re: getc( ) and gets( ) speed
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Dec 16, 2003
- 511 views
----- Original Message ----- From: "Robert Craig" <rds at RapidEuphoria.com> To: <EUforum at topica.com> Subject: Re: getc( ) and gets( ) speed > > > Derek Parnell wrote: > > However, gets() only works for text files, it makes a > > mess of binary files. > > gets() works fine on any kind of file. > It won't make a mess. You can use it to copy any file. > If the '\n' characters happen to be few and > far between, then the length of the "line" > that you read with gets() could be unpredictable and > very large. gets() is currently coded to run fast with > lines less than 1040 characters, but it will handle > lines of any length (as long as there's enough memory). > Of course you are correct. I was getting mixed up with opening a binary file in text mode. Now *that* is a bad idea. -- Derek