Here is my code thus far. Sorry for not putting it in a code box, but I didn't see anything that told me how.
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <string>
#include <fstream>
#include <iomanip>
using namespace std;
int main()
{
int i, w,ran; //number of lines in file
string n, mar, log;//mar=*s log= word
srand((unsigned)time( NULL ));
ran = rand();
w= 4;
for(i = 0; i < 1; i++)
{
i = w * rand() / 32767 ;
cout << i +1 << endl;
}
ifstream infile;
infile.open ("word.txt");
if (!infile)
{ cout << "There is no file. Failure. " << endl;
return 1; //comes back as failure
}
getline(infile,
mar[i];
while (mar.find(" ") != string::npos )
{
mar[1];
cout<< "*";
mar[2];
cout<<"*";
mar[3];
cout<< "*";
mar[4];
cout<< "*";
mar[5];
cout<< "*";
mar[6];
cout <<"*";
mar[7];
cout<<"*";
mar[8];
cout<<"*";
mar[9];
cout<<"*";
}
cout<< mar;
infile.close();
return 0;
}