Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: Swapping two values

by adrianh (Chancellor)
on Feb 15, 2003 at 23:36 UTC ( [id://235628]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # swap ($s, $p1, $p2, $n);
    # in $s swap the $n bits at bit $p1 and $p2
    ...
    print "$string\n";
    swap($string, 0,16,16);
    print "$string\n";
    
  2. or download this
    # swap first character with itself
    swap($string, 0, 0, 8);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://235628]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-18 06:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found