Obviously fro the source you can see i have no idea what i'm doing, but i hope you get the idea.
Code:
#include <fstream.h>
#include <iostream.h>
int main()
{
ifstream infile("input.txt");
ofstream outfile("wordlist.txt");
char word;
while (infile >> word)
{
if (word == ' ') word = '\n';
outfile << word;
infile.get(word);
outfile.put(word);
}
return 0;
}
The input.txt looks like this
Code:
ad am an as at ax cat dog pig horse animal
I'm trying to make the out put file look like this..
Code:
ad
am
an
as
at
ax
cat
dog
pig
horse
animal
"you get the idea...."
How do i accomplish this????