another problem xD


Not a clue, spent plenty of time staring blankly at the screen :L

compiler errors at 13x2, 15x2, 17x2 saying "expected primary expression before" for both of the variables.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
int main()
{
    short choice;
    cout << "Please type 1, 2 or 3 for either an int, long or floating caculation";
    cin >> choice;
    if (choice = 1);
       {
            if (choice = 2);

             {
            if (choice = 3);
            
               { average(float float);
               }
                average(long, long);
             }
        average(int, int);
       }
    else
        cout << "error";
        return 0;
}
Last edited on
if (choice = 1);
Did you mean if (choice == 1); ?

Your if statements do nothing anyway - that semi-colon you've put on the end of them is the end of the code that gets run if the statement passes. You need to go back and read about if statements again.


average(float float);
I presume you meant
average(float, float);
which makes no sense anyway.

What do you think this should do? It makes no sense. If you want to call a function, you have to create the values to pass into it, and then pass them in. For example,

float a = 1.0;
float b = 7.6;
average(a, b);
Last edited on
Just been over that again, I really did write a lot of crap :L
Topic archived. No new replies allowed.