delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/21/19:43:34

Message-ID: <344D0490.45DE@cs.com>
Date: Tue, 21 Oct 1997 19:37:52 +0000
From: "John M. Aldrich" <fighteer AT cs DOT com>
Reply-To: fighteer AT cs DOT com
Organization: Two pounds of chaos and a pinch of salt
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp AT delorie DOT com
Subject: Re: Scanf function
References: <Pine DOT SUN DOT 3 DOT 91 DOT 971021130337 DOT 3667D-100000 AT is>

Eli Zaretskii wrote:
> 
> John's analysis is very accurate.  Therefore, a simple solution is to
> change the format of the second `scanf', so it does skip whitespace:
> 
>   printf("Write a character: ");
>   scanf(" %c",&c);

Oh, gods yes.  Thank you, Eli - I totally forgot about that, since I
seldom use scanf() in my own programs.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |     mailto:fighteer AT cs DOT com     |
| "Starting flamewars since 1993"  |   http://www.cs.com/fighteer   |
|  *** NOTICE ***  This .signature is generated randomly.           |
|                  If you don't like it, sue my computer.           |
---------------------------------------------------------------------

- Raw text -


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