Results 1 to 5 of 5

Thread: [RESOLVED] DWORD bit set

  1. #1

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Resolved [RESOLVED] DWORD bit set

    Hi all,

    I have a variable define like this.

    Code:
    DWORD temp = 0;
    After doing some process, I want to set all bits(all 32 bits) into one. So I do this.

    Code:
    temp = 0xffffffff;
    Is that ok.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: DWORD bit set

    Yeah.

  3. #3

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: DWORD bit set

    Thanks,

    I have a trick too. Since it is unsigned long if I do this?

    Code:
    temp = -1;
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  4. #4
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: DWORD bit set

    Don't do that. It's not a trick, its misleading and bad practice.

  5. #5

    Thread Starter
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: DWORD bit set

    Ok. Thanks for the information.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width