I just can't figure out why this program isn't reading in the entire file. It will only read in the second line, nothing else.
Here are my read and write functions:
bool Write(string Text,string FileName){
fstream Write;
Write.open(FileName.c_str(),ios::out|ios::app);
if(!Write){
cout<<"Error in opening file";
return 0;
}
Write<<Text;
Write.close();
return 1;
}
void Read(string FileName){
char buffer[300];
fstream Read;
Read.open(FileName.c_str(),ios::in);
Read.seekg(0,ios::beg);
while(!Read.eof()) Read.getline(buffer,300);
cout<<buffer;
Read.close();
}
Thanks for your time,
Squirrel Prodigy