ok i am in the beginning stages and right now im just trying to make sure that my program opens a file for reading and opens a file for me to write output to but for some reason im gettin 26 errors using msv C++. Can someone help?
Code:
#include <stdlib.h>
#include <iostream>
#include <iomanip.h>
#include <fstream>
using std ::cout;
using std ::cin;
using std ::cerr;
using std ::ios;
using std ::endl;
using std ::ifstream;
int main()
{
//ifstream constructor opens file
ifstream inputFile("input.dat", ios:: in);
//exit program if unable to create file
if( !inputFile)
{
cerr<<File could not be opened"<<endl;
exit(1);
} //end if
//ofstream constructor opens file
ofstream outputFile("output.dat", ios:: out);
//exit program if unable to create file
if( !outputFile)
{
cerr<<"File could not be opened"<<endl;
exit(1);
} //end if
return 0;
}