www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/16/12:01:51

From: "Campbell, Rolf [SKY:1U32:EXCH]" <moscoop AT americasm01 DOT nt DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: checking int
Date: Thu, 16 Mar 2000 10:55:47 -0500
Organization: Nortel Networks
Lines: 16
Message-ID: <38D10403.EDCEDE1B@americasm01.nt.com>
References: <8alfpb$fle$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: wmerh0tk.ca.nortel.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.72 [en] (X11; I; HP-UX B.10.20 9000/785)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Florent wrote:

> Hi,
> I don't find the way to check if the input I give to the function scanf is
> an int or a char. For example you ask to enter an int, and if a char is
> entered -> BUG, so I need something to check if tne input is an int.
> It's easy to check if it's a char, but int .... I didn't find.

Read a string in, and then check that string to see if it only contains an
integer.

--
(\/) Rolf Campbell (\/)



- Raw text -


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