read in MYDATA (with a space) from cin and find MYDATA in the file, print the line if its there. The line is going to be MYDATA + string.

int main (){
fstream filename;[1]);
string name;
getline (cin, name);
lookeyLookey (name, filename);
void lookeyLookey (string& name, ofstream& filename){
    //how to look for MYDATA in file I have no idea
    if (found)
         cout << name << STRING AFTER MYDATA;

        cout << name << ": not found";

you need to put getline() in a loop inside the function lookyLooky() so that it reads all the lines in the file. Then on each loop iteration use the std::string's find() method to search for the desired text.

while( getline(filename, line) )
    // check to see if this line contains the desired string