First, sorry for the late response. I was sleeping and forgot to mention it in the last post.
@Ancient Dragon: I kind of get what you are saying because the file names do contain things like '\n' or '\r' in them, but your change to the Tokenize function breaks its generic functionality. This code doesn't work correctly:
int main()
{
vector<string> temp = Tokenize("blah;blah;blah;blah;", ';');
for (int i = 0; i < temp.size(); i++)
{
cout << temp[i] << endl;
}
return 0;
}
But, I get what you mean by having to take those \r or \n out of my file names.
@ArkM: Thanks for going through my code. But, I am a bit confused about some of your fixes:
1. At line 31, why do I need to reserve
size + size/10 ? Shouldn't it just be
size ?
2. For
FileToString , I was thinking of just returning the error code and not the file size because I can just do
fileS.size() . Is this a bad programming habit on my part?
Thanks all. I "approve" of all your posts :D (reputation)