Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
October 17, 2007 Octal to Decimal converter | ||||
---|---|---|---|---|
| ||||
Does anyone have a link to a Oct2Dec converter? I found ultox and xtoul, many thanks to SpottedTiger. Octal to decimal seem a little harder to locate. Todd |
October 17, 2007 Re: Octal to Decimal converter | ||||
---|---|---|---|---|
| ||||
Posted in reply to Todd | Todd wrote: > Does anyone have a link to a Oct2Dec converter? I found ultox and xtoul, many thanks to SpottedTiger. So, you found this thread then? http://www.digitalmars.com/d/archives/digitalmars/D/learn/read_Hexadecimal_value_from_string_8632.html > Octal to decimal seem a little harder to locate. strtoul decalred in std.c.stdlib will probably do what you want, google for it's MAN page or similar. Or as Frank suggested Tango has it covered. Regan |
October 19, 2007 Re: Octal to Decimal converter | ||||
---|---|---|---|---|
| ||||
Posted in reply to Regan Heath | > strtoul decalred in std.c.stdlib will probably do what you want, google for it's MAN page or similar. Or as Frank suggested Tango has it covered.
>
> Regan
I imported std.c.stdlib and got a compile error along the lines of:
data type std.c.stdlib stroul conflicts with stdlib stroul...
so I tried using stroul in stdlib by itself but it will require several conversions to make it work correctly.
Think I will write a function from scratch, wish me luck :)
Todd
|
October 19, 2007 Re: Octal to Decimal converter | ||||
---|---|---|---|---|
| ||||
Posted in reply to Todd Titus | Todd Titus wrote:
>> strtoul decalred in std.c.stdlib will probably do what you want, google for it's MAN page or similar. Or as Frank suggested Tango has it covered.
>>
>> Regan
>
> I imported std.c.stdlib and got a compile error along the lines of:
> data type std.c.stdlib stroul conflicts with stdlib stroul...
> so I tried using stroul in stdlib by itself but it will require several conversions to make it work correctly.
>
> Think I will write a function from scratch, wish me luck :)
>
> Todd
>
>
Try calling "std.c.stdlib.stroul" in your code instead of just "stroul".
--bb
|
October 19, 2007 Re: Octal to Decimal converter | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | > Try calling "std.c.stdlib.stroul" in your code instead of just "stroul".
>
> --bb
thought of that last night. working great now.
Todd
|
Copyright © 1999-2021 by the D Language Foundation