English Help

Hello,
I'm working on an English assignment where I have to make a really one sentence. I have 2 text files 1 holding nouns, and the other holding prepositions. I am trying to make a program to assemble them, pick one (hopefully random word) from a list in a text file, 1 word from the other list, assemble them and print it out into another text file in one really long sentence. I'm pretty sure this doesn't work yet, so any help is really appreciated.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <string>
#include <fstring>
#include <stdlib.h>
using namespace std;

int main()
{
 char noun [ size ];
 char prep [ size ];
 int w;
 while (w =< 9000){
  ifstream reader;
  reader.open ("nouns.txt");
  reader.getline (noun, size);
  reader.close();
  
  reader.open ("prepositions.txt");
  reader.getline (prep, size);
  reader.close();

ofstream printer;
 printer.open ("dump.txt");
 cout << prep << "the" << noun;
 printer.close();
 w++;
 }
}
Topic archived. No new replies allowed.