40 main(
int argc,
char *argv[])
43 cout <<
"Usage: " << argv[0] <<
" <number>\n";
49 #define OUTVAL(valtype, type) do { \
51 cout << "TYPE = " #valtype "\n"; \
52 if (to_number(s, value)) { \
53 cout << "Number(" << s << ") = " << dec \
54 << (unsigned long long)(unsigned type)value << "\n" \
55 << "Number(" << s << ") = " << dec \
56 << (signed long long)(signed type)value << "\n" \
57 << "Number(" << s << ") = 0x" << hex \
58 << (unsigned long long)(unsigned type)value << "\n" \
59 << "Number(" << s << ") = 0" << oct \
60 << (unsigned long long)(unsigned type)value << "\n\n"; \
62 cout << "Number(" << s << ") is invalid\n\n"; \
65 OUTVAL(
signed long long,
long long);
66 OUTVAL(
unsigned long long,
long long);
68 OUTVAL(
unsigned long,
long);
71 OUTVAL(
signed short,
short);
72 OUTVAL(
unsigned short,
short);
74 OUTVAL(
unsigned char,
char);
int main(int argc, char *argv[])
#define OUTVAL(valtype, type)