Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.c Subject: Re: Reading lines from a file, eliminating CR and LF Date: Sat, 07 Jan 2017 21:57:37 +0000 Organization: A noiseless patient Spider Lines: 35 Message-ID: <87mvf2o7n2.fsf@bsb.me.uk> References: <87pok9ilpd.fsf@bsb.me.uk> <6466708f-c0ee-457d-b1e8-e7817949c410@googlegroups.com> <87wpecidvw.fsf@bsb.me.uk> <0ffc9b05-76c6-47ef-8508-44d70383c2aa@googlegroups.com> <87ful0i5rq.fsf@bsb.me.uk> <87lgurfqmt.fsf@bsb.me.uk> <6921a3c5-02af-47ee-837c-9d72e2ba8890@googlegroups.com> <87k2abm2wf.fsf@bsb.me.uk> <5e5ee268-ad6a-4aea-a38d-749f5f73d024@googlegroups.com> <87mvf5k31l.fsf@bsb.me.uk> <878tqpi8x1.fsf@bsb.me.uk> <87o9zlggg7.fsf@bsb.me.uk> <401c510b-cfe5-4c91-a348-c2f290d96a91@googlegroups.com> <87eg0ggnbu.fsf@bsb.me.uk> <1ad79cea-958c-4236-a306-45c08f62c699@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="4900b6f12aae15f9895b22f3d05581d9"; logging-data="27265"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18teUx6PxcO0xoyxAO2i4FB0mRLK1e4hyE=" Cancel-Lock: sha1:ajiTLYGz41dv2QUgnVUaFQsoW0E= sha1:Ti1YIF9080tLAt7XrNwqbHeFt2k= X-BSB-Auth: 1.4c5e9954bd0da53377e6.20170107215737GMT.87mvf2o7n2.fsf@bsb.me.uk Xref: csiph.com comp.lang.c:101258 Alla _ writes: > On Friday, January 6, 2017 at 7:33:50 PM UTC+3, Ben Bacarisse wrote: >> Alla _ writes: >> > >> . >> . >> You can avoid the hassle of returning (and therefore test for) NULL >> simply by making this a "skip_space" function that returns a pointer to >> the first character that follows a run of isspace characters. Try that >> out and see how that makes the main function look. > While waiting for your reply, I have finally decided to look at the hint. > I don't want to allow myself to jump around in a surge of happiness, but > that is exactly what I came up with - without looking at the hint ) Oh, please, > let it be a sign of improvement. I know that it doesn't say much, but I do > live myself a chance; I truly want to improve my knowledge and skill. Of course it is a sign of improvement! Like any skill, programming takes time to learn -- lots of time. While there is no substitute for writing code, don't underestimate the value of reading other people's programs. I've learned countless things from people whose names I know longer recall simply because I read their code. > Ben, I can't find enough words to express my gratitude for your help, > your patience, and your truly perfect guidance - you don't solve things > for me, but you help me think and find the way myself thus increasing > chances of getting better at this thinking process. Of course, it would be > much easier for you to just come up with a solution and a code, but you > patiently wait to see how I fare based on your comments. Thank you! That's very gratifying to hear. Thank you. -- Ben.