Don't see the file

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

  1. DN Admin

    Staff Member

    Country:
    United States
    Joined:
    Aug 7, 2010
    Likes Received:
    258
    Trophy Points:
    45
    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,

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

    View the full article
     

Share This Page