Re: Long long int's and sprintf

From: Mike Stilson (mike@c746148-a.ehlls1.pa.home.com)
Date: 06/17/01


On Sun, Jun 17, 2001 at 02:04:12AM -0700, Peter Ajamian came up with this idea:
> Mike Stilson wrote:
> >
> > It does have strtoull defined in there though, and it does link, just
> > requires me to fill in the ptr & base for it to work right.
> > in other words, can't just do:
> > unsigned long long int var; var=strtoull(from);
>
> That's because that's not how strtoull() works.
>
> > have to do
> > unsigned long long int var; var=strtoull(from, NULL, 10);
>
> That's how strtoull() is supposed to work.

So I see from stdlib.h.  Not having the manpage for it (yet, suppose I should
upgrade) the first assumption was that it used the same format as the
atoi() type calls.

>
> Note that shoving a char * in for that NULL comes in handy at times for
> parsing, might wanna try it when you have more than one value on a line,

[snip]
So I see.  Definitely a function that's going to wind up in a few more places
in the code.

-mike

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/05/01 PST