Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!uwvax!oddjob!gargoyle!ihnp4!chinet!rlk From: rlk@chinet.UUCP (Richard Klappal) Newsgroups: comp.lang.c Subject: Re: QUES: fprintf - include white space Message-ID: <1354@chinet.UUCP> Date: Wed, 29-Jul-87 21:48:01 EDT Article-I.D.: chinet.1354 Posted: Wed Jul 29 21:48:01 1987 Date-Received: Sat, 1-Aug-87 04:43:46 EDT References: <11084@decwrl.DEC.COM> Reply-To: rlk@chinet.UUCP (Richard Klappal) Organization: Chinet - Public Access Unix Lines: 25 In article <11084@decwrl.DEC.COM> williamsm@armory.dec.com writes: > > My question concerns the function fscanf() on the vax. How do I > use fscanf() in such a way that it bring in the specified number of > characters including white space (more importantly ' '), with out > terminating the input to each field because of the white space. ... > MELVIN WILLIAMSMS > ARMORY::WILLIAMSM Can't guarantee that this will work on the vax, but my berserkelyoid compiler will accept (and the SysV documentation agrees) char string[10+1]; /* 10 chars plus terminating null */ ... fscanf(fp, "%10c", string); ... to read in 10 characters, regardless of whitespace, control codes, etc. -- --- UUCP: ..!ihnp4!chinet!uklpl!rlk || MCIMail: rklappal || Compuserve: 74106,1021 ..!ihnp4!ihu1h!rlk ---