Article View: alt.comp.lang.learn.c-c++
Article #730question about get_line implementation.
From: Centaury
Date: Sat, 29 Aug 1998 00:00
Date: Sat, 29 Aug 1998 00:00
19 lines
1603 bytes
1603 bytes
I need to implement a get_line routine. It should get ONE line from an input text file and return all characters as a pointer variable. And here are my considerations and trials: detect '\n' as the end-of-line character for the routine to return. After testing with a driver, I found out that it did the job, but it returns extra funny characters which are always the same character type. I suspect that it is CR or FF. Can anyone confirm this? If that is the case, how should I logically combine '\r' with '\n' as a testing condition in the while loop? One more question: does the current cursor position of a file persist througout the file's open lifetime, regardless of where it's scope is?? Thanks a million, and please send replies/comments to: utopian@hehe.com
Technical Details
Message-ID:
<35e70268.0@news2>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f67c,11de81bc1593f087,start X-Google-Attributes: gid10f67c,public X-Google-Thread: 114592,11de81bc1593f087,start X-Google-Attributes: gid114592,public X-Google-Thread: 1014db,11de81bc1593f087,start X-Google-Attributes: gid1014db,public X-Google-Thread: 106434,11de81bc1593f087,start X-Google-Attributes: gid106434,public From: "Centaury" <utopian@hehe.com> Subject: question about get_line implementation. Date: 1998/08/29 Message-ID: <35e70268.0@news2> X-Deja-AN: 387163414 X-NNTP-Posting-Host: klj-60-38.tm.net.my X-Trace: 29 Aug 1998 03:18:00 +0800, klj-60-38.tm.net.my Organization: TMnet Malaysia Newsgroups: alt.comp.lang.learn.c-c++,comp.lang.c,fj.lang.c,it.comp.lang.c X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3