I have a class problem help please

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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <iostream>
#include <windows.h>
using namespace std;
class car
{
      public:
             int color;
             int tires;
             int minspeed;
             int maxspeed;
             int hood;
             int door;
             int window;
      protected:
                int engine;
                }
      
class hood
{
      public:
             void up();
             void down();
             void unlock();
             void lock();
      protected:
                void change();
                }
class door
{
      public:
             void open();
             void close();
             void lock();
             void unlock();
             }

class window
{
      public:
             void rollup();
             void rolldown();
             }
             
class engine
{
      public:
             void start();
             void stop();
      protected:
                int overheat;
                int cooldown;
                
                
void car::engine()
{ //line 55
     engine.car::engine()start
     cout << "Car Started";
     } //line 58 


my compiler gives me 4 errors:
-invalid member funtion declaration (line 55)
-expected '}' at end of input (line 58)
-expected unqualified-id at end of input (line 58)
-expected ',' or ';' at end of input (line 58)

problem is, whatever I do it doesn't help.
please help me and tell me what is wrong with this car class program.
(not yet finished btw)

I'm using the C++ compiler from Bloodshed Dev C++ 4.9.9.2
You need an 'main' function.

You forgott the () after engine in the car declaration
It looks like your only problem is the lack of a closing brace after your engine class. It will fix all of the above errors.
Ok thanks guys =D
Topic archived. No new replies allowed.