1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| #include "Lecture.h"
#include "stdafx.h"
#include <iostream>
#include <string>
#include "Bonjour.h"
#include <vector>
#include <fstream>
using namespace std;
std::string lecture(std::string ligne)
{
ifstream lit("E:/C++/FICHIERS/LOGIN.DAT"); //Ouverture d'un fichier en lecture
if (lit)
{
vector<string> table; // Déclaration du tableau dynamique
for (int i = 0; i < table.size; i++)
{
string mot;
lit >> mot;
table.push_back(mot);
cout << table[i] << endl;
}
}
else
{
cout << "ERREUR: Impossible d'ouvrir le fichier en lecture." << endl;
}
return 0;
} |