S
Steven T. Hatton
I say no, 0 is _not_ a decimal literal. Anybody disagree? If you do agree
with me, then what do you think it is?
with me, then what do you think it is?
benben said:Doesn't 0 mathematically mean 0 (zero, null, nil) in decimal, binary,
hexadecimal, etc whatever number system you can devise?
Ben
Steven said:I say no, 0 is _not_ a decimal literal. Anybody disagree? If you do agree
with me, then what do you think it is?
Ron said:A naked 0 is a octal-literal according to the C++ standard.
A decimimal literal is a single non-zero digit followed
by zero or more digits.
Steven T. Hatton said:I'm speaking strictly in lexical terms. How would a C++ grammarian classify
0? I believe you are correct regarding semantics.
Not really, because an octal integer literal will result in the creation ofStarfox said:As much as I think this is pointless, this might solve the argument,
sort of:
std::cout << typeid(0).name();
I say no, 0 is _not_ a decimal literal. Anybody disagree? If you do agree
with me, then what do you think it is?
Jack said:I think you are wasting the group's time playing with silly newbie
exercises. Suppose some particular compiler gets it wrong, and parses
it as a decimal literal. How could you tell the difference?
I say no, 0 is _not_ a decimal literal. Anybody
disagree? If you do agree
with me, then what do you think it is?
Tescobar said:In my opinion, naked zero must be a separate lexical token (from compilers
point of view).
If not, why is it possible to initialize pointers
by zero:
some_type* p=0;
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.