Text Parser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shing
    New Member
    • Mar 2007
    • 58

    Text Parser

    Can someone tell me what the program is dumping? Looks like some kind of memory code. Memory dump maybe?

    Code:
    #include <iostream>
    #include <fstream>
    using namespace std;
    
    int main () {
      ofstream myfile;
      myfile.open ("log.txt");
      myfile << "Writing this to a file.\n";
      myfile.close();
      cout << myfile;
      return 0;
    }
    Output of program:
    0x22fed0
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Originally posted by shing
    Can someone tell me what the program is dumping? Looks like some kind of memory code. Memory dump maybe?

    Code:
    #include <iostream>
    #include <fstream>
    using namespace std;
    
    int main () {
      ofstream myfile;
      myfile.open ("log.txt");
      myfile << "Writing this to a file.\n";
      myfile.close();
      cout << myfile;
      return 0;
    }
    Output of program:
    0x22fed0

    Hi ,
    it is printed by this line
    cout << myfile;
    It is printing the address of the handle.


    Raghuram

    Comment

    • shing
      New Member
      • Mar 2007
      • 58

      #3
      What do u mean by that?

      Comment

      • gpraghuram
        Recognized Expert Top Contributor
        • Mar 2007
        • 1275

        #4
        Originally posted by shing
        What do u mean by that?

        R u referring to address?


        Raghuram

        Comment

        Working...