Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Anyone noticed that...

Anyone noticed that...

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Munchies_Matt
    wrote on last edited by
    #1

    unsigned val = ~0 results in 11001100110011001100110011001 If val is an int it is of course 11111111111111111111111111111111, which you expect. But why does unsigned behave so strangely?

    L 1 Reply Last reply
    0
    • M Munchies_Matt

      unsigned val = ~0 results in 11001100110011001100110011001 If val is an int it is of course 11111111111111111111111111111111, which you expect. But why does unsigned behave so strangely?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I have:

      unsigned foo = ~0;

      and the debugger shows:

      foo = 0xffffffff

      So, in answer to your question, "no, I haven't".

      CPalliniC 1 Reply Last reply
      0
      • L Lost User

        I have:

        unsigned foo = ~0;

        and the debugger shows:

        foo = 0xffffffff

        So, in answer to your question, "no, I haven't".

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        You beat me on that. :thumbsup:

        In testa che avete, signor di Ceprano?

        L 1 Reply Last reply
        0
        • CPalliniC CPallini

          You beat me on that. :thumbsup:

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Looks like MM posted that while drunk.

          CPalliniC 1 Reply Last reply
          0
          • L Lost User

            Looks like MM posted that while drunk.

            CPalliniC Offline
            CPalliniC Offline
            CPallini
            wrote on last edited by
            #5

            :beer: :beer: :beer: (in order to reproduce his test)

            In testa che avete, signor di Ceprano?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups