I have to get this program to read from a text file and write the data to another text file. The problem i'm having is the format. It's typing everything on one line
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
//reading data from a file
int main()
{
const int size = 244;
char numbers[size];
int count;
ifstream inputfile;
ofstream outputfile;
inputfile.open("grades.txt");
for (count = 0; count < size; count++)
inputfile >> numbers[count];
inputfile.close();
for (count = 0; count < size; count++)
{
cout << numbers[count];
}
//Writing data to a file
outputfile.open("report.txt");
outputfile << "*******************************************************************************************************************************************"<<endl;
outputfile << "--------------------------------------------Dr. David Smith, Associate Professor-----------------------------------------------------------"<<endl;
outputfile << "--------------------------------------------Blue Ridge Community College-------------------------------------------------------------------"<<endl;
outputfile << "*******************************************************************************************************************************************"<<endl;
for (count = 0; count < size; count++)
outputfile <<numbers[count];
outputfile.close();
return 0;
}