If it does, then do cout<<line before the call to system to check the validity of the string. If the string is not correct, then it's a file read issue.
getline (myfile,line);
system("del mydoc.doc") //< this code work to delete mydoc.doc
system(line); //<-- but this one is not working.
cout << line << endl; //<-- also this one working it prints "del mydoc.doc"
also
i trying this code
command = "del mydoc.doc";
system(command); //<-- not working