Sujet : Re: What is your opinion about unsigned int u = -2 ?
De : bluemanedhawk (at) *nospam* invalid.invalid (Blue-Maned_Hawk)
Groupes : comp.lang.cDate : 01. Aug 2024, 07:34:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <pan$d2c8a$8c54ac9f$29a202e0$12c6ce86@invalid.invalid>
References : 1
User-Agent : Pan/0.154 (Izium; 517acf4)
Thiago Adams wrote:
What is your opinion about this:
unsigned int u1 = -1;
Generally -1 is used to get the maximum value.
Is this guaranteed to work?
Whether or not it is, i would prefer to use the UINT_MAX macro to make the
code clearer.
How about this one?
unsigned int u2 = -2;
Does it makes sense? Maybe a warning here?
I cannot think of any situations where that would make sense, but i also
cannot guarantee that there are not any.
-- Blue-Maned_Hawk│shortens to Hawk│/blu.mɛin.dʰak/│he/him/his/himself/Mr.blue-maned_hawk.srht.siteI was so amused with it that i did it twenty-three more times.