B
Bern
how to specifiy a binary number in c++?
hex numbers are specified by 0x prefix
hex numbers are specified by 0x prefix
Bern said:how to specifiy a binary number in c++?
hex numbers are specified by 0x prefix
Specifying binary numbers hampers readability of the code. InBern said:how to specifiy a binary number in c++?
hex numbers are specified by 0x prefix
Bern said:how to specifiy a binary number in c++?
hex numbers are specified by 0x prefix
Risto said:[By the way, C and C++ are perhaps the only programming languages
having no token representing decimal zero! :-]
- Risto -
red floyd said:Risto said:[By the way, C and C++ are perhaps the only programming languages
having no token representing decimal zero! :-]
- Risto -
what would the token 0 be, then?
Mike said:red floyd said:Risto said:[By the way, C and C++ are perhaps the only programming languages
having no token representing decimal zero! :-]
- Risto -
what would the token 0 be, then?
Octal zero. (it begins with the '0' character).
-Mike
Kai-Uwe Bux said:I am confused?
What exactly is the difference between the numerical constant 0_8 denoted
by the string "0" in octal notation versus the numerical constant 0_10
denoted by the string "0" is decimal notation (as existent in other
languages). In particular, what is
0_8 - 0_10
Kai-Uwe Bux
Kai-Uwe Bux said:Mike said:red floyd said:Risto Lankinen wrote:
[By the way, C and C++ are perhaps the only programming languages
having no token representing decimal zero! :-]
- Risto -
what would the token 0 be, then?
Octal zero. (it begins with the '0' character).
-Mike
I am confused?
Perhaps.
What exactly is the difference between the numerical constant 0_8 denoted
by the string "0"
in octal notation
versus the numerical constant 0_10.
denoted by the string "0"
is decimal notation
(as existent in other
languages).
In particular, what is
0_8 - 0_10
Another less common but easier way for some is to use octal (whose
prefix is plain '0'), which is a bit easier to cope with than hexadecimal
numbers.
[By the way, C and C++ are perhaps the only programming languages
having no token representing decimal zero! :-]
That's a VERY confusing question. Your terminology and representations are
difficult to comprehend. But I'll try to address what I THINK you're
asking:
There is no difference in the value STORED when you write any if the
following:
int hexInt = 0x08;
int octInt = 08;
int decInt = 8;
Kai-Uwe Bux said:I am confused?
You would have done better to pick 7 or less for the example.
0x08 == 010 there is no "8" in Octal.
Bern said:why doesn;t C/c++ support binary numbers?
rossum said:You would have done better to pick 7 or less for the example.
0x08 == 010 there is no "8" in Octal.
Bern said:well, i tought of a good format to use for binary integers.
0b1011_1001 (equals to dec. 185)
or
0_1011_1001
the first character is a digit zero then followed by a letter 'b'.
not all people has such a powerful imagination as you.
Here's my solution. As far as I know it only works up to VC10 (not inclusive)how to specifiy a binary number in c++?
hex numbers are specified by 0x prefix
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.