1. I believe the segmentation error came from the fact that you used a forward slash after "c:" instead of a backward slash, because it worked after I changed it to a backward slah.
2. I'm not sure if I'm doing something wrong, but the program didn't seem to want to open "c:\employees.dat", because I believe root directory used in a filestream is the folder that the file is in. Therefore, just put the .dat file in the same place as the program.
3. The program did not work for reading in the lines properly when I test-drove it. I added a .ignore function, which seems to have cleared it up.
Anyways, here's what it looks like; this should work:
cerr << "File cannot be opened!" << endl;
for (int i = 0; !data.eof(); i++)
cout << s1[i] << endl;