473,325 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

swapping values

how will u swap two values neither using temporary variables nor memory references
May 13 '10 #1

✓ answered by Frinavale

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.

4 1451
Dheeraj Joshi
1,123 Expert 1GB
Have you heard of operations 'AND' 'OR' 'XOR' etc?

Regards
Dheeraj Joshi
May 13 '10 #2
@dheerajjoshim
ya but how will u implement 'AND' 'OR' 'XOR' for swapping
May 13 '10 #3
Dheeraj Joshi
1,123 Expert 1GB
Please Google and see yourself.
Here is wiki link

Regards
Dheeraj Joshi
May 13 '10 #4
Frinavale
9,735 Expert Mod 8TB
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.
May 13 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Christopher Jeris | last post by:
Please help me understand the differences, in semantics, browser support and moral preferredness, between the following three methods of swapping content in and out of a page via JavaScript. I...
16
by: Sethu Madhavan | last post by:
Hi All Here i am facing one technical issue related to Swapping the Object Instance in Dotnet. e.g.. class Customer{ Order _lastOrder;
4
by: alanrn | last post by:
I am using a TreeView to display the hierarchy of a strongly-typed collection (inherited from CollectionBase). The order of the nodes in the TreeView is strictly tied to the order in which they...
270
by: Jatinder | last post by:
I found these questions on a web site and wish to share with all of u out there,Can SomeOne Solve these Porgramming puzzles. Programming Puzzles Some companies certainly ask for these...
28
by: rajendra.stalekar | last post by:
Hi Folks!!! I have a string let's say "hi" and got to reverse it using just a single variable for swapping, how do I do it? Regards, Rajendra S.
9
by: storyGerald | last post by:
I knew some ways of swapping two ints without using a temporary variable. Just like: // Method 1: void swap1(int &a, int &b) { int temp = a; a = b; b = a; }
2
by: TuftyTrue | last post by:
Hi, On my site the user can browse to an image with <input type=file etc>. Althrough I have no problem swapping images with: document.getElementById('PictureToDisplay').src =...
0
by: sklett | last post by:
I've got a new DGV problem that makes no sense. I need to implement a very simple "row move" operation in a DGV. basically if the user pressed Shift+Up or Shift+Down the selected row and it's...
5
bluechimera
by: bluechimera | last post by:
Of course this isn't the whole program.... but it is a rather large slice of code. Yes I am in college, I am not asking for someone to do this for me.. I think that is rather stupid... you don't...
0
by: ghjk | last post by:
I'm using jsp. I want to print string array values . How can I do that? please help me. This is my code. ArrayList settings = (ArrayList)session.getAttribute("settingList");
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.