From: "Campbell, Rolf [SKY:1U32:EXCH]" 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 (\/)