Begginer question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fermineutron

    #1

    Begginer question

    I googled for it but found 0 results "|=" my question is:

    what does |= do?

    | is a bitwise or
    = is equal
    but what |= do?


    I am using C not C++ if it makes any difference.

  • Joe Wright

    #2
    Re: Begginer question

    fermineutron wrote:
    I googled for it but found 0 results "|=" my question is:
    >
    what does |= do?
    >
    | is a bitwise or
    = is equal
    but what |= do?
    >
    >
    I am using C not C++ if it makes any difference.
    >
    You should have a good C book. Then you should read the book.

    --
    Joe Wright
    "Everything should be made as simple as possible, but not simpler."
    --- Albert Einstein ---

    Comment

    • Frederick Gotham

      #3
      Re: Begginer question

      fermineutron:
      >| is a bitwise or
      >= is equal
      but what |= do?
      x = x + 5;
      x += 5;

      x = x | 5
      x |= 5;

      --

      Frederick Gotham

      Comment

      • fermineutron

        #4
        Re: Begginer question

        Frederick Gotham wrote:
        fermineutron:
        >
        | is a bitwise or
        = is equal
        but what |= do?
        >
        x = x + 5;
        x += 5;
        >
        x = x | 5
        x |= 5;
        Thanks

        Comment

        • Keith Thompson

          #5
          Re: Begginer question

          "fermineutr on" <free4trample@y ahoo.comwrites:
          I googled for it but found 0 results "|=" my question is:
          >
          what does |= do?
          >
          | is a bitwise or
          = is equal
          but what |= do?
          Look up "compound assignment" in your C textbook or in the standard.

          --
          Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
          San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
          We must do something. This is something. Therefore, we must do this.

          Comment

          Working...