Been looking on the internet and have been unable to locate anything to help me with this (that is clear cut to the point where I can understand it at least).
1 2 3 4 5 6 7
ifstream AAA ("BBB.txt");
if (AAA.is_open())
{
std::string part1;
}
This is just a snippet of the code. All I want to do is find the command(s) necessary to convert the entire text file into the string I've called "part1". That's it. The text file is actually an html website saved to a text file, but I want to convert it to a string and manipulate it from there but I don't know the command to convert the entire text file (which may vary in size) into a single string.
int character;
while((character = AAA.get()) != EOF) //while we haven't reach the end of the file
{
part1 += char(character); //add the character to the string
}