I need your help. I don't understand why but, when I compile my program, it crashes. If I remove the
bool c = tabInt==TabInt2;
in my main, it doesn't crash. Do you have any idea on how to solve the problem?
MonTableau.h
template <class Type> class MonTableau
{
    private:
    int debut;
    int fin;
    int taille;
    Type * adr;
    public:
        MonTableau (int, int);
        MonTableau (int);
        ~MonTableau();
        Type & operator [] (int);           
        bool operator == (MonTableau) const;
        bool  operator != (MonTableau) const;
};
MonTableau.cpp
#include <iostream>
#include "MonTableau.h"
using namespace std;
template<class Type> 
MonTableau<Type> :: MonTableau (int d, int f)
    {
        if(f>d)
        {
            debut=d;  fin=f ; taille= f-d; adr= new Type [taille];
        }
        else
        {
            cout << "Taille non valide" << endl;
        }
    }
template<class Type> 
MonTableau<Type>::      MonTableau (int f)
    {
        if(f>0)
        {
            debut=0;  fin=taille=f ; adr= new Type [taille];
        }
        else
        {
            cout << "Taille non valide" << endl;
        }
    }
template<class Type> 
MonTableau<Type>::  ~MonTableau() {delete adr;}
template<class Type> 
    Type& MonTableau<Type>::  operator [] (int i)
    {
    return adr[i-debut];
    }
template<class Type>            
bool MonTableau<Type> :: operator == (MonTableau a) const
{
if(taille==a.taille)
{
    for(int k=0;k<taille;k++)
        {
            if( adr[k] != a.adr[k])  return false;
        }
         return true;
}
else return false;
}
template<class Type> 
bool MonTableau<Type>:: operator != (MonTableau a) const
{
if(taille==a.taille)
{
    for(int i=0;i<taille;i++)
        {
            if(adr[i]!=a.adr[i])  return true;
        }
         return false;
}
else return true;   
}
int main()
{
MonTableau<int> tabInt(5);
MonTableau<int> TabInt2(-2,3);
for(int i=0;i<5;i++)
{
    TabInt2[i-2]=tabInt[i]=i;
}
bool c = tabInt==TabInt2;
return 0;
}
 
     
     
     
    