Re: newbie having trouble with conversion program
- From: "Dan P." <dperlbergerN0SPAM@xxxxxxxxx>
- Date: Thu, 21 Apr 2005 11:37:08 GMT
<sfraney@xxxxxxxxxxxx> wrote in message
news:1114014812.038163.5060@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hmmm, thanks Richard. I have the While in place to make sure the user
> only puts 1 or 2, as far the numbers go but I cannot figure out how to
> utilize that to also say no alphas allowed. Any hints?
>
You can use a function like fgets() to get the input from stdin. Then you
can use strtol() to convert that into a long. If the user typed in "x" for
instance, it would error out (i.e. return a 0).
Dan
.
- Follow-Ups:
- Re: newbie having trouble with conversion program
- From: SM Ryan
- Re: newbie having trouble with conversion program
- References:
- newbie having trouble with conversion program
- From: sfraney@xxxxxxxxxxxx
- Re: newbie having trouble with conversion program
- From: Richard Bos
- Re: newbie having trouble with conversion program
- From: sfraney@xxxxxxxxxxxx
- newbie having trouble with conversion program
- Prev by Date: Re: Problem with printing input.
- Next by Date: Re: Problem with printing input.
- Previous by thread: Re: newbie having trouble with conversion program
- Next by thread: Re: newbie having trouble with conversion program
- Index(es):
Relevant Pages
|