Menu

file io

2003-02-18
2012-09-26
  • Nobody/Anonymous

    what is the command to read in from a file, I only know how to do it in linux and it doesn't work the same way;
    for Linux:         infile.open("Test.txt",ios::in);

     
    • Nobody/Anonymous

      (1) Do not hit refresh in this forum!
      (2) Did you include the right headers?

      Wayne

       
    • Nobody/Anonymous

      yes I am sure that I have the right headers, and I made sure that I have the text file available too.  I ran this at school on a linx os machine and it ran fine but when i run it here at home on a win98se machine it just outputs random characters, not the characters that I have stored in the text file.
      This is my function.........apstring IfStream()
      {

        ifstream infile;
        infile.open("Test.txt",ios::in);
      }

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.