|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2005-07-13 10:26:20
Russell Hind <rh_gmane_at_[hidden]> writes:
> Vladimir Prus wrote:
>>
>> Why is that better than
>>
>> unsigned x = strtoul("1010010001000010000001", 0, 2);
>>
>> ? I believe that 'strtoul' is part of C99.
>>
>
> When I've done something similar to the binary template, it was for
> compile-time calculations, whereas strtoul I assume is a runtime call.
Not to mention that the number is a lot easier to read when divided
into nibbles ;-)
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk