Re: newbie having trouble with conversion program




<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


.



Relevant Pages