Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/02/2015, 13:13
amchacon
 
Fecha de Ingreso: julio-2012
Mensajes: 375
Antigüedad: 11 años, 9 meses
Puntos: 28
Respuesta: Como leer file txt con ifstream c++

Un bucle hasta que fin.good() sea false.

Código C++:
Ver original
  1. while (fin.good())
  2. {
  3.     fin.getline(buffer,999);
  4.  
  5.     // hacer algo con la linea, como mostrarla por pantalla
  6.     cout<<buffer<<endl;
  7. }