How to read from a file then display to console?

I am stuck on a problem. It asks me to :
Write a program that reads from total.dat file and displays its contents to the console. The program should allow the user to add new entries to the file.

So far this is what I've got and I'm not sure if I even started right.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <fstream>
using namespace std;


int main ()
{
	ifstream dataIn;
	ofstream dataOut;

	dataIn.open("total.dat");

	cout << dataIn;



	return 0;
}


If anyone can help me that'd be greatly appreciated thanks
Last edited on
Topic archived. No new replies allowed.