negro_sto
23-02-2008, 21:31:01
Hola, mi problema es el siguiente, tengo que leer una lista de datos desde un txt y cargarlos a un vector, el tema es que si cargo una fecha (señalada con:"-->aca"), al correr el programa, lo compila, pero enseguida me sale el siguiente aviso:
Debugger Exeption Notification
Proyectproyect1.exe raised exception Class EConverter error whit message"" is not a valid date'.Process sttoped. use Step or Run to continue.
Si leo un txt sin fecha pero con todo lo otro anda bien.
aguien me puede ayudar??, desde ya muchas gracias
Estoy trabajando con c++ builde 6, el codigo es el siguiente:
ifstream archie("historial.txt");
if(archie.is_open()){
while(!archie.eof()){
datos aux;
archie.ignore();
getline(archie, aux.a);
if(aux.a=="zz")break;
getline(archie, aux.b);
getline(archie, aux.c);
string j, y;
getline(archie, j);
aux.d=StrToTime(j.c_str());
getline(archie, y);
aux.e=StrToTime(y.c_str());
archie>>aux.f;
string u;
/*aca--->*/ getline(archie, u);
/*aca--> */ aux.g=StrToDate(u.c_str());
au.v.push_back(aux);
}
archie.close();
}
else
ShowMessage("no se pudo abrir el archivo");
Debugger Exeption Notification
Proyectproyect1.exe raised exception Class EConverter error whit message"" is not a valid date'.Process sttoped. use Step or Run to continue.
Si leo un txt sin fecha pero con todo lo otro anda bien.
aguien me puede ayudar??, desde ya muchas gracias
Estoy trabajando con c++ builde 6, el codigo es el siguiente:
ifstream archie("historial.txt");
if(archie.is_open()){
while(!archie.eof()){
datos aux;
archie.ignore();
getline(archie, aux.a);
if(aux.a=="zz")break;
getline(archie, aux.b);
getline(archie, aux.c);
string j, y;
getline(archie, j);
aux.d=StrToTime(j.c_str());
getline(archie, y);
aux.e=StrToTime(y.c_str());
archie>>aux.f;
string u;
/*aca--->*/ getline(archie, u);
/*aca--> */ aux.g=StrToDate(u.c_str());
au.v.push_back(aux);
}
archie.close();
}
else
ShowMessage("no se pudo abrir el archivo");