primary expr?

Hi.What's wrong with the code:

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
#include <iostream>

using namespace std;

class base1
{
      public:
             base1(char the_char);
};

class base2{
      public:
             base2(char the_char);
};

class derived: public base1, base2{
      public:
             derived(char c1, char c2, char c3);
       };
       derived::derived(char c1, char c2, char c3):base1(c3),  base2(c2)
             { cout << c1;
             }
       
             
             base1::base1(char the_char){cout<<the_char;}
             base2::base2(char the_char){{cout<<the_char;}
             
int main()
{
    derived derived_object('f','a','r');

     while(1);
     return 0;
}


I get the error:
27 C:\Documents and Settings\soheil\My Documents\testsuit\AS\91s114.cpp expected primary-expression before "int"
Last edited on
You're missing a closing brace and a semicolon after your derived declaration.
base2::base2(char the_char){{cout<<the_char;}

Here only one { needed, that's the error.

Thanks
Thanks all.May I move the line 20-26 inside the class?
yes just remove the scope resolution stuff
Topic archived. No new replies allowed.