Re: a DWORD with all bits set...
On Wed, 03 Jun 2009 18:41:49 -0400, r norman <r_s_norman@comcast.net>
wrote:
You keep repeating the purpose to be assigning an unsigned integer the
largest value of its type from some value of a signed type. You are
correct in your argument based on this completely weird assumption.
I keep repeating the subject line of this post: a DWORD with all its
bits set, something you completely ignore. I don't see any reference
in the query to "largest value of an unsigned type from a signed
type".
LOL! The original post in this thread was:
is there any logical differnce between
DWORD dwFoo = -1;
and
DWORD dwFoo = ~0;
is there a reason to prefer one of them?
That's exactly what I've been talking about in every post I've made here!
If you don't understand how this and the subject line relate to what I said
about "assigning an unsigned integer the largest value of its type from
some value of a signed type" well, all I can suggest is what I told you in
my first reply to you, that you carefully study every post I've made in
this thread. You should also brush up on elementary C or C++. At a minimum,
you ought to know that -1 and ~0 have the type int, the type int is signed,
a "DWORD with all bits set" is the largest value of the unsigned type
DWORD, and more generally, the largest value of any unsigned type T is the
value with all bits set. If you understood these things, you wouldn't keep
replying as you've been doing.
Considering we are arguing two entirely different subjects, I
don't see any point in continuing this.
As far as the discussion with you goes, I've only been responding to your
disagreements with the correct information I've been posting and your
various incorrect statements. If you've been trying to talk about something
else, it's lost in all your other nonsense.
--
Doug Harrison
Visual C++ MVP