Foro de elhacker.net

Programación => Programación C/C++ => Mensaje iniciado por: MellaSystems en 19 Mayo 2015, 03:22 am



Título: Ayuda por favor un error
Publicado por: MellaSystems en 19 Mayo 2015, 03:22 am
Tengo esta funcion amigos, antes de uso un deque<cEstudiante> dEstudiante

Código
  1. void eliminar_estudiante(){
  2.    int cont = -1;
  3.    char op;
  4.    string matricula;
  5.    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), Color_Yellow);
  6.    cout<<"      ---------------------------------------------------------------------\n";
  7.    cout<<"             <<<<<<<<<<     ESTUDIANTES->ELIMINAR        >>>>>>>>>>";
  8.    cout<<"\n      ---------------------------------------------------------------------\n";
  9.    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), Color_Def);
  10.    cout<<endl;
  11.    cout<<"\n\tELIMINAR UN ESTUDIANTE";
  12.    cout<<"\n\n\tIngrese la posici\242n:"; cin>>matricula;
  13.    for(it=dEstudiante.begin(); it!=dEstudiante.end(); ++it){
  14.        cEstudiante PrintEstudiante = *it;
  15.            if((*it) == matricula){      
  16.  dEstudiante.erase(find(dEstudiante.begin(),dEstudiante.end(), matricula));
  17.   deque<dEstudiante>::iterator itTemp = --it;
  18.               cont++;  
  19.               cout<<"\n\n\tREGISTRO ELIMINADO...!!!!!\n";    
  20.               }
  21.               } if (cont == -1){
  22.                       cout<<"\n\tMATRICULA INCORRECTA...!!\n";
  23.               }cont = -1;
  24.        do{
  25.  
  26.        cout<<"\n\n\tDesea seguir eliminando? <S/N>: ";
  27.        cin>>op;
  28.        switch(op){
  29.            case 's':   system("cls");
  30.                        eliminar_estudiante();
  31.                        break;
  32.            case 'S':   system("cls");
  33.                        eliminar_estudiante();
  34.                        break;
  35.            case 'n':   return ;
  36.  
  37.            case 'N':   return ;
  38.  
  39.            default: cout<<"\n\t Ingrese una opcion valida";
  40.            }
  41.    }while(op=='y'||op=='Y');
  42. }

Me da error:
265 C:\Users\JuanaG\Programacion\Estructura de Datos\DataBases.cpp no match for 'operator==' in '(&it)->std::_Deque_iterator<_Tp, _Ref, _Ptr>::operator* [with _Tp = cEstudiante, _Ref = cEstudiante&, _Ptr = cEstudiante*]() == matricula'