Need Help with a Single (Simple) Error

Can't figure out whats wrong but probably glazing over it.

the error is:
In function 'void order(double&, double&, double&)':
error: expected ';' before 'a'
a = b
^
The code is:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 #include <iostream>
#include <string>
#include <cmath>
using namespace std;
void get_data (double &a, double &b, double &c);
void swap (double &x, double &y);
void order (double &a, double &b, double &c);


void get_data (double &a, double &b, double &c)
{
    cout<< "Enter three integers: \n";
    cin>>a>>b>>c;
}

void swap (double &x, double &y)
{
    double temp;
    temp = x;
    x = y;
    y = temp;
}

void order (double &a, double &b, double &c)
{
    if (a<b)
        swap (a, b);
    if (c<a)
        swap (a, c);
    if (b<a)
        swap (b,a);
    
}

int main()
{
    double a, b, c;
    get_data(a,b,c);
    order(a, b, c);
    cout << a << endl;
    cout << b << endl;
    cout << c << endl;
    return 0;
}
Compiles fine for me as posted.
Are you sure you posted the correct code?

a = b
^

I see no line that contains a=b
I sure did.
I am only getting this error in Emacs, which I have to use for this. Xcode and c++ shell are both working. I don't understand what the issue could be.
fun stuff: even after deleting the void order function and recompiling I am getting this one error.
fixed it! was a bug in saving files
Topic archived. No new replies allowed.