순차 파일을 만들려고하는데 작동하지 않는 것 같습니다. 아무도 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 << "? ";
}
}
다음은 한 줄을 입력 한 후의 출력입니다.
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).
사용중인 입력의 예를 인용 해 주시겠습니까? –
사용중인 입력은 다음과 같습니다. 03062011 1030 2.5 치과 의사 청소 Joshua 5552492131 – Joshua
나는 작동 할 수 있습니다. 방금 int 변수를 double 값으로 변경했습니다. – Joshua