Don't see the file

Discussion in 'Visual C++ .Net' started by DN Admin, Apr 13, 2012.

  1. DN Admin

    Staff Member

    Joined:
    Aug 7, 2010
    Location:
    Joliet, IL U.S.A.
    Hi,
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New'; color:green Having run this,
    </span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New'; color:green // basic file operations</span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New'; color:blue #include</span><span style="font-size:10.0pt; font-family:'Courier New'
    <span style="color:#A31515 "stdafx.h"</span></span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New'; color:blue #include</span><span style="font-size:10.0pt; font-family:'Courier New'
    <span style="color:#A31515 <iostream></span></span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New'; color:blue #include</span><span style="font-size:10.0pt; font-family:'Courier New'
    <span style="color:#A31515 <fstream></span></span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New'; color:blue using</span><span style="font-size:10.0pt; font-family:'Courier New'
    <span style="color:blue namespace</span> std;</span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New' </span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New'; color:blue int</span><span style="font-size:10.0pt; font-family:'Courier New' main () {</span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New' <span>
    </span>ofstream myfile;</span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New' <span>
    </span>myfile.open (<span style="color:#A31515 "c:example.txt"</span>);</span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New' <span>
    </span>myfile << <span style="color:#A31515 "Writing this to a file.n"</span>;</span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New' <span>
    </span>myfile.close();</span>
    <p style="text-autospace:none <span style="font-size:10.0pt; font-family:'Courier New' <span>
    </span><span style="color:blue return</span> 0;</span>
    <span style="font-size:10.0pt; font-family:'Courier New' }</span>
    Why don’t I see this file <span style="font-size:10.0pt; font-family:'Courier New'; color:#A31515
    "c:example.txt"?</span>
    <hr class="sig Many Thanks & Best Regards, Hua Min

    View the full article
     
    #1

Share This Page