The plan is to read the source code of another program, determine where the comments are(anything that has // before it), then replace the whole comment with spaces so that the program will ignore the comments when parsing.
// a comment that should disappear
while (src.getline(line, sizeof(line)))
ptr = strstr(line, "//");
if (ptr != nullptr)
*ptr = '\0'; // this will remove anything after ptr
cout << line << "\n";