The way you are trying to incorporate the wrong concept of const variables in your program is causing all the problems.
If you declare a variable as const, you need to specify the const qualifier before the dataype, like this:
const int SIZE = 10 ; // you must specify the value
Since const variables can't be modified (alteast not using the same name) you need to specify an initial value for the variable the way I have done above. Also since initialization of non static members inside a class is not allowed in C++, so you have to make those variables static.
static const double dt=1.0 ;
static const double gravity=0.5 ;
static const double engine_strength = 1.0 ;
static const double safe_velocity = -0.5 ;
static const char burn_key = 'b';
You could also create a seperate header file with the constants and include it whenever you need to use the values.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
Offline 8,873 posts
since Jun 2006