void FindString() { const int iMaxRecLength = 1024; ifstream fin; char *sBuffer = new char[iMaxRecLength]; const char *filename = "c:\\temp\\fichier.txt"; fin.open(filename, ios::in); while (!fin.eof()){ fin.getline(sBuffer, iMaxRecLength);; if (strstr(sBuffer, "friend") != 0) cout << sBuffer << endl; } fin.close(); }
#include #include <fstream.h> #include <string.h>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question