I'm supposed to write a function named double_swap that takes two doubles as arguments and interchanges the values that are stored in those arguments. The function should return no value, so I know it needs to be written as a void. An example I was given is as follows:
If this code fragment is executed,
int main()
{
double x = 4.8, y = 0.7;
double_swap(x,y);
cout<<"x="<<x<<"y="<<y;
}
The output will be:
x=0.7 y=4.8
This is the code I came up with, but it won't compile. Can someone point out my errors? Thanks in advance.