• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

C# test - no googling

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    Originally posted by DimPrawn View Post
    Yes the compiler assigns the number as integers, because there is no + operator on a short! Then of course the implicit conversion of an int to a short fails at compile time.
    That's just plain stoopid.

    It'll work in C. Should have called it Cb obviously.
    Will work inside IR35. Or for food.

    Comment


      #12
      Have you tried turning it off and on again?
      Originally posted by Stevie Wonder Boy
      I can't see any way to do it can you please advise?

      I want my account deleted and all of my information removed, I want to invoke my right to be forgotten.

      Comment


        #13
        Originally posted by DimPrawn View Post
        You are close.

        Yes the compiler assigns the number as integers, because there is no + operator on a short! Then of course the implicit conversion of an int to a short fails at compile time.
        I am sure that works the same in java although I really can't be arsed opening up an editor and testing it.

        Comment


          #14
          Originally posted by aussielong View Post
          Maybe the compiler infers the type of "x + y" to be an int since it could overflow a short. Then youd have to cast that explicitly to a short to assign to "z".
          That would make sense if int+int = long as well. But it doesn't.

          Comment


            #15
            The only shorts I'm interested in are served in a small glass or worn by a half-naked lady...

            Comment


              #16
              Originally posted by minestrone View Post
              I am sure that works the same in java although I really can't be arsed opening up an editor and testing it.
              Yep. A shortcut would be z = x += y, no pun intended.

              Comment


                #17
                What a stupid design.

                Principle of least astonishment - Wikipedia, the free encyclopedia
                "A life, Jimmy, you know what that is? It’s the s*** that happens while you’re waiting for moments that never come." -- Lester Freamon

                Comment


                  #18
                  Originally posted by KentPhilip View Post
                  The only shorts I'm interested in are served in a small glass or worn by a half-naked lady...
                  You need to have your mouth cleaned...

                  Comment


                    #19
                    Originally posted by AtW View Post
                    You need to have your mouth cleaned...
                    That won't be possible. You know the listerine dragon clifford, I made him swallow his own fire, and he cooked himself

                    Comment

                    Working...
                    X