• Asignatura: Informática
  • Autor: LuizaPlays60241
  • hace 8 años

Visualizar contenido de archivo text c++ , .

Respuestas

Respuesta dada por: victorosornio8ozp3x4
1

#include <iostream>

#include <fstream>

#include <string>

using namespace std;


void main ()

{

        string STRING;

ifstream infile;

infile.open ("names.txt");

        while(!infile.eof) // To get you all the lines.

        {

        getline(infile,STRING); // Saves the line in STRING.

        cout<<STRING; // Prints our STRING.

        }

infile.close();

system ("pause");

}

Preguntas similares