>      outfile.open ("//usr//address//book.txt", ios::out); // Opens
book.txt

        It is unnecessary to double up the slashes.

        >
        > but i want it to open to say my dunny dir or my msd dir...and then
make
        > the dir/file
        >
        > how?
        >

        #include <stdlib.h>
        #include <string.h>
        #include <iostream.h>
        #include <fstream.h>

        int main()
        {
          ofstream outfile;
          char name[1000];
          strcpy(name, getenv("HOME"));
          strcat(name, "/book.txt");
          outfile.open(name);
          // write exciting stuff to outfile
          outfile.close();
          return 0;
        }


        -TAG


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to