someone help me pls I do not know how to create the code for highlighting a word from a string file I will just simply put an open and close parenthesis to the word which will serve as the tool for highlighting
btw here's the code
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
void getFile(ifstream& open_file, string paragraph);
void contentFile(ifstream& open_file);
int main()
{
ifstream fin;
getFile(fin, "Paragraph.txt");
contentFile(fin);
return 0;
}
void getFile(ifstream& open_file, string paragraph)
{
open_file.open(paragraph.c_str());
if (open_file.fail())
{
cout << "Input file opening failed" << endl;
exit(1);
}
else
{
cout << "Input file opening successful" << endl;
}
}
void contentFile(ifstream& open_file)
{
string line;
while (!open_file.eof())
{
getline(open_file, line);
cout << line << endl;
}
}