Menu

file io again

2003-02-18
2012-09-26
  • 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);
    }

     
    • Nobody/Anonymous

      Saying that you are "sure" does not really help.  You should have responded with what you linked.  (Actually, a simple program that illustrates your problem, with the compile log included is the way to go) I can't tell you how many times folks were "sure" their "Hello world" was right, when it wasn't close.

      And stay on one thread...don't start any more new ones!!!!!!

      Wayne

       
    • Nobody/Anonymous

      Here is an simple (I wrote it after all) example I worked on a few months ago to show file status error stuff for C++ notation.  Retarded, but it works...

      Wayne

      #include <iostream>
      #include <fstream>
      #include <stdio.h>
      #include <stdlib.h>
      using namespace std;

      int main(void)
      {
         ifstream myfile("waynesatwit");
         if(myfile.rdstate() == ios::failbit)
           cout << "Error...!\n";
         else
           cout << "Found him\n";        
         myfile.close();
         cout << "hello world\n";
         system("PAUSE");
         return 0;
      }

      Wayne

       

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.