There's a post at the top of the forum Read This before posting . It talks about using code tags and posting well indented and easy to read code. Please go through it.
Agni
Practically a Master Poster
655 posts since Dec 2007
Reputation Points: 431
Solved Threads: 116
In addition to Agni's post: You should also post the errormessages you get.
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
Try reformatting your code, it's damn hard to read with all those white lines in it...
anyway, the error you posted is probably due to this line: void jumpright(screen &x, game &t)
Here you tell the function "jumpright" that it can expect a class 'game', but the problem is that the class 'game' is not yet defined. You define the class a few lines later.
There are a number of horrible hacks to makes this code compile, but what I would really recommend is that you learn how to use header files.
Put your declaration in the header file like this (dani.h)
class foo
{
public:
foo();
~foo();
void func(void);
};
class bar
{
public:
bar();
~bar();
void func2(void);
};
Now you can put the defenition in the cpp file:
dani.cpp:
#include "dani.h"
void bar::func2()
{
foo * f = new foo();
//foo is declared
delete f;
}
void foo::func()
{
bar * b = new bar();
// bar is in declared
delete b;
}
Don't forget to make a body for constructer/destructors to !
also read this about using void main()
And you also might want to update your compiler (turbo) to something from the last 10 years... Visual studio 2008 express is free for example
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403