swapping values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sinjanv
    New Member
    • May 2010
    • 6

    #1

    swapping values

    how will u swap two values neither using temporary variables nor memory references
  • Dheeraj Joshi
    Recognized Expert Top Contributor
    • Jul 2009
    • 1129

    #2
    Have you heard of operations 'AND' 'OR' 'XOR' etc?

    Regards
    Dheeraj Joshi

    Comment

    • Sinjanv
      New Member
      • May 2010
      • 6

      #3
      Originally posted by dheerajjoshim
      Have you heard of operations 'AND' 'OR' 'XOR' etc?

      Regards
      Dheeraj Joshi
      ya but how will u implement 'AND' 'OR' 'XOR' for swapping

      Comment

      • Dheeraj Joshi
        Recognized Expert Top Contributor
        • Jul 2009
        • 1129

        #4
        Please Google and see yourself.
        Here is wiki link

        Regards
        Dheeraj Joshi

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          You could also consider pushing the values onto the stack and popping them off into the swapped variable. Depends on how low level you're going I guess.

          Comment

          Working...