i got the Maze class to generate a Random Maze. So the problem i face is that i want to throw some exceptions about the size of the maze ( i want to put a minimum), also if the number of columns is pair ( i neeed to make the maze symmetric). So i dont know how to handle three or 4 different exceptions and generate an error message
class Maze { 
  private: 
    int nr; // number of rows
    int nc; // number of columns
    int complex; // complexity of the maze: how hard to leave
    vector< vector<int> > vec; //array bidimensional de enteros
    //vector de dos dimensiones
    /*vector<T> elems;     // elements 
     // Create
    vector< vector<int> > vec(4, vector<int>(4));
    // Write
    vec[2][3] = 10;
    // Read
    int a = vec[2][3];*/
  public: 
    void Maze();
    void Maze( int rows, int columns, int hard);
    void PrintMaze();
    void ShowMaze(vec);
    bool isConnected ();
    void explore (Node posicion);
    bool validMove( Node actual);
    Node RandomNode(); // Obtienes un nodo al azar valido
    Node MirrorNode (Node actual); //devuelve el nodo espejo/mirror de un nodo null en otro caso..
    void reverseExplore();
    int getnr();
    int getnc();
    int getComplex();
    void setnr();
    void setnc();
    void setComplex();
    } 
}; 
void Maze::Maze(void) {
         cout <<"No hace naA"<<"\n\n";
}
void Maze::Maze(int rows, int columns, int hard) {
        //Comprobar numer filas y columnas es par/impar y sino salir dando mensaje correspondiente
    /*
    if (nr %2) != 0) {
        fprintf(stderr, "Error: El numero de filas tiene que ser par/impar.\n");
        exit();
        return 101;
    } else if (nc % 2 != 0) {
        fprintf(stderr, "Error: El numero de filas tiene que ser par/impar", nproc);
        return 102;
    }
    if (mr < 20 || nc < 10) {
        fprintf(stderr, "Error: El laberinto tiene que tener al menosu unas medidas\n");
        exit();
        return 103;
    }
*/
    nr=rows;
    nc=columns;
    hard=0;
    bool Final=false;
    Node actualNode;
    setupMaze();   //Inicializar laberinto ( todo a 0, poner los  bordes y casilla inicial)
    do {
        actualNode=randomNode();     //Obtengo un nodo aleatorio valido: que no sea pared y este en los limites
        addNode(actualNode); //Añado el nodo al laberinto
        if ( isConnected();) {
            //hard=0; //opcional para contar solo las veces que intenta en el  "mismo intento", ahora al colocar el nodo bien puedes inicializar los intentos a 0.
            cout << "\nInsercion correcta del nodo\n"; // compruebo si el laberinto es conexo o nodo
        }
        else {
            //Si laberinto resultante no es conexo, tengo que deshacer la inserción del nodoactual e incrementar el valor de hard
            deletenode( actualNode);
            hard++; 
        }
    while ( hard <= complex)
}
I need to make in C++ something like this in C. I would generate a maze with mymaze.maze( 40,80,10). I need to control this values in order to generate an symmetric maze and assure that the input variables have valids values ( number of rows have to be pair, maze has to has a minimum size of 20x10):
if (nr %2) != 0) {
            fprintf(stderr, "Error: El numero de filas tiene que ser par/impar.\n");
            exit();
            return 101;
        } else if (nc % 2 != 0) {
            fprintf(stderr, "Error: El numero de filas tiene que ser par/impar", nproc);
            return 102;
        }
        if (mr < 20 || nc < 10) {
            fprintf(stderr, "Error: El laberinto tiene que tener al menosu unas medidas\n");
            exit();
            return 103;
        }
    */
Thanks in advance
 
    