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. Other Discussions
  3. The Weird and The Wonderful
  4. How about some paradox

How about some paradox

Scheduled Pinned Locked Moved The Weird and The Wonderful
6 Posts 4 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    int i = 0; int m = 1; while ( i < m){ Print i Print m i = i + 1; m = i; }

    nananaanananan code man!

    P 1 Reply Last reply
    0
    • L Lost User

      int i = 0; int m = 1; while ( i < m){ Print i Print m i = i + 1; m = i; }

      nananaanananan code man!

      P Offline
      P Offline
      phil o
      wrote on last edited by
      #2

      This code can be simplified with

      m = i++;

      :sigh:

      No memory stick has been harmed during establishment of this signature.

      L P 2 Replies Last reply
      0
      • P phil o

        This code can be simplified with

        m = i++;

        :sigh:

        No memory stick has been harmed during establishment of this signature.

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

        how about we change "i" to a "C" huh ;)

        1 Reply Last reply
        0
        • P phil o

          This code can be simplified with

          m = i++;

          :sigh:

          No memory stick has been harmed during establishment of this signature.

          P Offline
          P Offline
          Peter_in_2780
          wrote on last edited by
          #4

          Unless my remaining braincell is taking the day off, shouldn't that be

          m = ++i;

          ? Cheers, Peter

          Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

          P 1 Reply Last reply
          0
          • P Peter_in_2780

            Unless my remaining braincell is taking the day off, shouldn't that be

            m = ++i;

            ? Cheers, Peter

            Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

            P Offline
            P Offline
            phil o
            wrote on last edited by
            #5

            Should it?

            No memory stick has been harmed during establishment of this signature.

            F 1 Reply Last reply
            0
            • P phil o

              Should it?

              No memory stick has been harmed during establishment of this signature.

              F Offline
              F Offline
              Freak30
              wrote on last edited by
              #6

              Yes, it should. And this little change makes the diffrence between a loop that runs once and a loop that runs forever. :)

              The good thing about pessimism is, that you are always either right or pleasently surprised.

              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