www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Octal to Decimal converter

reply Todd <toddtitus mindspring.com> writes:
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
 
Oct 17 2007
parent reply Regan Heath <regan netmail.co.nz> writes:
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
Oct 17 2007
parent reply Todd Titus <toddtitus mindspring.com> writes:
 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
Oct 18 2007
parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
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
Oct 18 2007
parent Todd <toddtitus mindspring.com> writes:
 Try calling "std.c.stdlib.stroul" in your code instead of just "stroul".
 
 --bb
thought of that last night. working great now. Todd
Oct 19 2007