Re: What does !! do?

Discussion in 'C++' started by Balog Pal, Jan 23, 2013.

  1. Balog Pal

    Balog Pal Guest

    On 1/23/2013 4:24 PM, Bint wrote:
    > I haven't seen this syntax before. What does "!!" do in C++?
    >
    > As in this statement
    >
    > int t = !!(x & size);


    !! converts to bool. You can see many uses with WIN32 API that has
    type BOOL that is really int and can have all kind of values.
    !! makes sure those decay to true/false (1/0).
     
    Balog Pal, Jan 23, 2013
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bill Johnson
    Replies:
    0
    Views:
    1,265
    Bill Johnson
    Jul 8, 2005
  2. Replies:
    3
    Views:
    532
    Ken Cox [Microsoft MVP]
    Oct 7, 2005
  3. Janet Collins
    Replies:
    0
    Views:
    1,179
    Janet Collins
    Jan 13, 2006
  4. Replies:
    1
    Views:
    898
    Juan T. Llibre
    Feb 8, 2006
  5. Alek Nazarian
    Replies:
    7
    Views:
    3,304
    Alek Nazarian
    Oct 22, 2003
Loading...

Share This Page