#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
/* base */
inline void error(const string& s)
{
throw runtime_error(s);
}
/* base */
inline void error(const string& s, const string& s2)
{
error(s + s2);
}
int _tmain(int argc, _TCHAR* argv[])
{
cout << "Please enter input file name : ";
string iname;
cin >> iname;
ifstream ist{ iname };
if (!ist) error("can't open input file", iname);
cout << "file found" << endl;
unsigned int curr = 0;
string line;
string search = "Test10"; /*Aranacak değer*/
while (getline(ist, line))
{
curr++;
if (line.find(search, 0) != string::npos)
{
cout << "Bulunan : " << search << " Bulunan Satır : " << curr << endl;
}
}
int st = 0;
cin >> st;
}