Jump to content

Yet another question.

Featured Replies

what's the value of ~(char)(!!9) ? Again, good luck.

first off the !!9 = 1 . ! (not operator) returns 0 if the value is non-zero, so !9 = 0 !!9 = !0 = 1, or the same as saying if not 9 = 0 in the possible answers of 0 and 1, then not not 9 must equal 1. !!!9 would then = 0 and !!!!9 = 1, and so on.

the ~ (tilde) operator is a bit-wise one's complement, which is very easy just invert all the bits

!0001100 = 1110011

so lets assume you have a one byte value, which when you said (char), makes it. it equals one (0000 0001) now if you perform a one's complement on that number you should get

1111 1110 which would be either 254 or -2 :confused: , negative numbers in binary or such a pain :(

you have to know when your dealing with them in assembly, c++ and other high languages take care of this for you, thats why you have to specify signed/unsigned if you need the extra space cause in signed variables the last bit is needed as the sign bit, 1 = negative, 0 = positive.

i was wondering why a link to this place was on the corral.net forums...but im glad i saw it.

Adrian is very active on that forum and offered to post on it on behalf of this site. We very much appreciate it :)

  • Author

What about this thread on corral ? Give me the link.

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.