Skip to content

Commit

Permalink
Lecture fichier txt
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfg94 authored May 25, 2018
1 parent e421aa4 commit 3ca96c9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <iostream>
#include <fstream>


using namespace std;


int main()
{


// Permet de lire le contenu du fichier texte fourni
ifstream myfile ("test.txt");
if (myfile.is_open())
{
string line;
while ( getline (myfile,line) )
{
cout << line << '\n';
}
myfile.close();
}
else cout << "Impossible d'ouvrir le fichier";
return 0;
}

0 comments on commit 3ca96c9

Please sign in to comment.