Lot's of unexepted errors

I got Dev-C++ 4.9.9.2, and i watched tutorial and in this code there's a lot of errors such as "default arguments are only permitted for function parameters " , "expected `,' or `...' before ';' token " and "expected constructor, destructor, or type conversion before '>>' token ", but in the video
he has no errors. Please, any help will be usefull. And help.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<iostream>
using namespace std;

int main(void)
(

      double dnumber1 = 0.0;
      double dnumber2 = 0.0;
      double dnumber3 = 0.0;
      double daverage = 0.0;
      
      cout << "please enter enter 3 number: " << endl;
      cin >> dnumber1;
      cin >> dnumber2;
      cin >> dnumber3;
      
      daverage = (dnumber1 + dnumber2 + dnumber3) / 3;
      
      cout << "the average of the numbers are:  " << daverage << endl << endl;
      
      return 0;
)
You have used ( and ) instead of { and } on line 5 and 22.
use void main instead of int main(void)

use void main instead of int main(void)

What?
Thanks Peter87
Code Apperentice wrote:
use void main instead of int main(void)

Don't do that. The return type of main() should be int. Some compilers allow void but it's not standard C++.
Here here.
ok Peter87
Topic archived. No new replies allowed.