Hey!
I have a very simple program, nothing much:
Code:
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <sstream>
using namespace std;
string InfoCollectDataHolder;
class ParseText
{
public:
ParseText();
~ParseText();
void Parse();
protected:
};
ParseText::ParseText()
{
}
ParseText::~ParseText()
{
}
void ParseText::Parse()
{
ifstream FileToParse("InfoCollect.txt");
if (FileToParse)
{
ostringstream oss;
oss << FileToParse.rdbuf();
InfoCollectDataHolder = oss.str();
}
else
{
InfoCollectDataHolder = "Sorry, couldn't open file...";
}
cout<<InfoCollectDataHolder;
}
int main()
{
ParseText ParseExample;
ParseExample.Parse();
cin.get();
}
And of course right next to it, I have the text file it wants. But it just gives me the error, showing it can't open the file...
Any clue on this one?
Thanks!
FlyingIsFun1217
Bookmarks