Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a sequential file
    primarykey
    data
    text
    <p>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?</p> <pre><code>#include &lt;iostream&gt; #include &lt;string&gt; #include &lt;fstream&gt; #include &lt;cstdlib&gt; using namespace std; int main() { ofstream outClientFile( "clients.dat", ios::out); if (!outClientFile) { cerr &lt;&lt; "File could not be opened" &lt;&lt; endl; exit(1); } cout &lt;&lt; "Enter the Appointment Date, Time, Duration, Name," &lt;&lt; endl &lt;&lt; "Description, Contact Name, and Contact Number.\n? "; int appDate, appTime, appContactNum; string appName, appDescription, appContactName; double appDuration; while ( cin &gt;&gt; appDate &gt;&gt; appTime &gt;&gt; appDuration &gt;&gt; appName &gt;&gt; appDescription &gt;&gt; appContactName &gt;&gt; appContactNum ) { outClientFile &lt;&lt; appDate &lt;&lt; ' ' &lt;&lt; appTime &lt;&lt; ' ' &lt;&lt; appDuration &lt;&lt; ' ' &lt;&lt; appName &lt;&lt; ' ' &lt;&lt; appDescription &lt;&lt; ' ' &lt;&lt; appContactName &lt;&lt; ' ' &lt;&lt; appContactNum &lt;&lt; endl; cout &lt;&lt; "? "; } } </code></pre> <p>And here is the output after I enter one line. </p> <pre><code>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). </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload