#include "extern.h"
#include <fstream>
+#include <stdio.h>
using std::ofstream;
using std::ifstream;
{
ofstream outfile;
outfile.open(filename);
+
if (outfile.fail())
{
log("Error opening %s", filename);
return;
}
- outfile << "";
-
ListNode<myString> *it;
it = news.First();
while (it)
while (infile.getline(buf, 1024, '\n'))
{
+ if (buf[0] == '\0' || buf[0] == '\n')
+ {
+ delete [] buf;
+ return;
+ }
string = new myString(buf);
news.insertAtBack(string);
delete string;