Re: c++ and writing to files

1998-05-13 Thread Matthew Smith
Try something like: char fname[2048]; // maybe dynamically allocate char *home = getenv("HOME"); sprintf(fname, "%s//book.txt", home); outfile.open(fname, ios::out); #Thanks, #Matt Smith #== #[EMAIL PROTECTED] >>> <[EMAIL PROTECTED]> 05/12 6:40 PM >>> I want to write to a fi

RE: c++ and writing to files

1998-05-13 Thread Gibson, Todd
> 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? >

Re: c++ and writing to files

1998-05-13 Thread David Spencer
Michael S. Dunsavage wrote: > > I want to write to a file in a home directory..but i want each user to > write the file to his/her dir have you tried using ~? (= user's home directory; e.g. my login file can be referenced with ~/.login.) -- PLEASE read the Red Hat FAQ, Tips, Errata and the