Home Forums C Programming Make a simple text file

Viewing 0 reply threads
  • Author
    Posts
    • #1889
      will
      Participant

      Small program to show you how to create a text file.

      #include
      #include
      main(){
      ofstream out ("test.txt");
      if(!out){
           cout<<"Can not open";
           return 1;
      }
      out <<10<<" "<<23.<<"n";
      out<<"This is short file";
      out.close();
      return 0;
      }

Viewing 0 reply threads
  • The forum ‘C Programming’ is closed to new topics and replies.