![]() |
Swap two integers without using a temporary variable
Here's a clever little algorithm you can use to swap two integers without using a temporary variable.
I rediscovered this tip, by Muhammad Saied, while reviewing my ![]() Dunno why, but I find this strangley pleasing! Assume we have two integers, A & B, both of which have values assigned. Swap their values like this: <div style="text-align: left;"> |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:08 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz