----- Original Message ----- 
From: "peternilsson42" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, June 24, 2008 6:31 PM
Subject: Re: [c-prog]


Thomas Hruska <[EMAIL PROTECTED]> wrote:
> Paul David wrote:
> > It's my understanding that sprintf() converts numbers into
> > strings (correct me if i'm wrong)   I need to convert a
> > string into a number
>
> ANSI:  strtol()
> Non-ANSI:  atoi()/atol()

Both atoi() and atol() are standard C functions. Perhaps you're
thinking of itoa()?

-- 
Peter

Depends on what kind of number. atoi() changes str to int. strtod() chnages 
str to double or float. You must be passing these parameters to main.

(int argc,char *argv[]) as two parameters.

Bill


Reply via email to