I'm cryptically told nothing more then "your code is almost completely wrong"
this is supposed to be a program that reads from an input file (infile.dat) one line of "programming advice" to a user. Then the user enters their own advice for the next person who runs the program to see. When you're done entering the advice supposedly you press enter twice to end the program
Not looking for someone to just give me code...just looking to understand what I'm doing so wrong -_-
thanks
#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main (void)
{
string first, words;
ifstream in_stream;
ofstream out_stream;
in_stream.open("infile.dat");
if (in_stream.fail())
{
cout << "Input file opening failed" << endl;
exit(1);
}
out_stream.open("infile.dat");
if (out_stream.fail())
{
cout << "Output file opening failed" << endl;
exit(1);
}
cout << "Press enter to see some advice to help you with programming" << endl;
getline (cin, first);
cout << first << endl;
cout << "Now enter some advice for the next person to see this" << endl;
do
{
getline (cin, words);
out_stream.put (words);
}
while (words != '/n');
in_stream.close();
out_stream.close();
system ("pause");
return 0;
}