// ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
while (getline(input, line))
pos = line.find("hey");
if (pos != string::npos) // string::npos is returned if string is not found
cout << "Found!";
As a design, that's a dangerous tool. One slip of the command and you can delete everything.
I'd highly suggest you reconsider for a version that is reversible. Say, move all the files to another directory, which could easily be deleted once it is verified the find was correct.
That said, this is OS specific, but if you're willing to use the new std Filesystem features in C++17, you have tools for recursive or single directory searching for files, which is then portable to most operating systems.
If you can use Boost, the very same Filesystem is available for older C++ standards.
There is a directory iterator, which would allow you to sequence through the files.