delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/06/17:03:47

Message-Id: <199905062054.PAA15797@darwin.sfbr.org>
Date: Thu, 6 May 1999 15:54:44 -0500 (CDT)
From: Jeff Williams <jeffw AT darwin DOT sfbr DOT org>
Subject: OT: skip remainder of input line following `#' ?
To: djgpp AT delorie DOT com
MIME-Version: 1.0
X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4m sparc
Reply-To: djgpp AT delorie DOT com

-: Warning: fflush() doesn't flush input streams, nor should it.
-:          Perhaps you want scanf("%*[^\n]\n") instead ?

The recent exchange regarding fflush(stdin) got me wondering if there
is an equally clever way (i.e., using the scanf format specifications)
to skip the remainder of an input record if a # symbol is encountered
(e.g., so that comments could be appended to the end of fixed (except
for white space) format data records).

TIA,
jeff


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019