by: Steve |
last post by:
How do you rewrite the swap function without using a tmp variable in
the swap function????
int main()
{
int x = 3;
int y = 5;
// Passing by reference
|
by: OSHIMA |
last post by:
Hi,
I found the swap() function without a temporary variable.
void swap(int *x, int *y){
*x ^= *y;
*y ^= *x;
*x ^= *y;
}
So, I wrote the next code that exchange the double.
|
by: Abhishek Jha |
last post by:
hello all,
this has been an interesting topic since long. you can swap two
numbers (say a and b) using temp(as third variable). you can also swap
without using third variable.likeThis was also...
|
by: pras.vaidya |
last post by:
hi, please help me with this problem : -
how to swap two addresses .For eg variable i is located at 2000 and j
at 3000 . Now i call swap function . Result should be that i should be
now having...
|
by: Jack White |
last post by:
Does anyone know if an analogue to the "swap()" function found in C++ exists
in C#. For those not familiar, let's say you have a function that loads some
collection passed in by reference. If an...
|
by: indrawati.yahya |
last post by:
OK, before you all stab me with your OT pitchfork, I just want to
mention that this question is indeed related to c.l.c++. My question
is, does the well-known method to swap two integers produce...
|
by: sksriharsha |
last post by:
In a C++ quiz, we were asked to write a program to swap two integer variables without using a third temporary variable.
Any suggestions??
|
by: Chad |
last post by:
I hope this question doesn't appear twice. I tried posting it once,
however, I got a stupid 505 internal error on google. When this
happens, the post will either post 30 minutes later or won't post...
|
by: raylopez99 |
last post by:
In the otherwise excellent book C# 3.0 in a Nutshell by Albahari et
al. (3rd edition) (highly recommended--it's packed with information,
and is a desktop reference book) the following statement is...
|
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...
|
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: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|