So, I start C++ at 0, and cannot seems to get code block to work

So I created a new project, and a typical "Hello World" pop up and I click run, it works. But, when I change the Hello world to something else, and hit build, an error message pop up "expected initializer before 'int'".
2, Is this just bad install or I set up a new project wrong or what.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  #include <iostream>
  Using namespace std

  int math (int x, int y, int z)

  int main()  // This line is where the error meaasge point me to.
  {
     cout << int math << endl;
     return 0;
  }

  int math(int x, int y, int z)
  {
   int math = (a+b)/c;
   return math;
  } 
Add a semicolon to terminate the declaration of the function in line 4.
1
2
// int math (int x, int y, int z)
    int math (int x, int y, int z) ; // semicolon added 
Line 4: missing the semi colon after the function.
Line 8: To use the function, you have to do something like math(10,2,5) since it takes 3 parameters.

Thank you.
Topic archived. No new replies allowed.