hello, i am (super) new in c++ and i have a problem in read a text file,to display the text in DOS command,for example i would like to display a text file information in
(C:\Documents and Settings\Steve\Desktop\Project\example.txt)
the content such like:
Lim, 11111, study
Alice, 22222, Exam
Raymond, 33333, sick
Rick, 44444, exercise
i knew this can be very easier to write q coding but i am too noob (mb)

. can anyone give me a help and your helpful will be so appreciated.
this is my example coding i take from web but also display nothing....
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
int main ()
{
char buffer[4];
ifstream examplefile ("example.txt");
if (! examplefile.is_open())
{
cout << "Error opening file";
exit (1);
}
while (! examplefile.eof() )
{
cout <<"hello";
examplefile.getline (buffer,3);
cout << buffer << endl;
}
return 0;
}