I'm trying to create a sequential file but it doesn't seem to be working. Can anyone explain how to get this to work in MS Visual Studio 2010?
#include <iostream>
#include <string>
#include <fstream>
#include <cstdlib>
using namespace std;
int main()
{
ofstream outClientFile( "clients.dat", ios::out);
if (!outClientFile)
{
cerr << "File could not be opened" << endl;
exit(1);
}
cout << "Enter the Appointment Date, Time, Duration, Name," << endl
<< "Description, Contact Name, and Contact Number.\n? ";
int appDate, appTime, appContactNum;
string appName, appDescription, appContactName;
double appDuration;
while ( cin >> appDate >> appTime >> appDuration >>
appName >> appDescription >> appContactName >> appContactNum )
{
outClientFile << appDate << ' ' << appTime << ' ' << appDuration << ' ' << appName << ' ' << appDescription << ' ' << appContactName << ' ' << appContactNum << endl;
cout << "? ";
}
}
And here is the output after I enter one line.
Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
The program '[452] CSC275 Assignment 3.exe: Native' has exited with code 0 (0x0).