
13 Jul
2005
13 Jul
'05
2:36 p.m.
Scott Schurr wrote:
Greetings,
Prompted by some discussion on comp.sdt.c++.moderated, I have a small template that allows the user to declare an integer literal in binary.
Usage looks like:
#include "binary_int.hpp"
unsigned int binary = binary_int<1001,0011,1011,0000>::b;
Why is that better than unsigned x = strtoul("1010010001000010000001", 0, 2); ? I believe that 'strtoul' is part of C99. - Volodya