Is it possible to initialize a const member in a class?
Normally, I would make it static const and initialize it right in the .h, but in this case I don't want to make it static. Every time I try to initialize, I get an error. Is there a simple way to do it?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#ifndef Maze_h
#define Maze_h
#include <string>
class Maze
{
public:
...
private:
constint r = 9;
constint c = 9;
int exit_row;
int exit_column;
};
#endif