COPY A LINES IN BINARY FILE

Dear All,

I would like to use a code to extract some lines in binary file and send the result to a ini file. when I try with this code and use a simple word "param" I don't get any thing

I would like your help

#include <iostream>
#include <fstream>
#include <string>

using namespace std;

bool isWanted(const std::string & line);

int main()
{
ifstream fin("Test.txt");

string line;
while (getline(fin, line))
{
if (isWanted(line))
cout << line << endl;
}
return 0;
}
bool isWanted(const std::string & line)
{
// any selection criteria you like
return (line.find("two") != string::npos);
}
Last edited on
Topic archived. No new replies allowed.