files

This is a discussion on files within the Windows Programming forums, part of the Platform Specific Boards category; Im pretty shure this is a windows question, so im asking it here. Is there a way to save a ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    25

    files

    Im pretty shure this is a windows question, so im asking it here. Is there a way to save a fstream file in a different file folder than the program?

    for example say my program creates a file called "the.txt", and the program is in C:\documents and settings\c++. how could i save it in C:\documents and settings\the ?

  2. #2
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    Pass the directory when you create the file... like "C:\\Documents and settings\\the.txt" to either the constructor or the call to open().

    Nothing Windows specific about this question... fstream is C++, post (next time) in C++.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ressources files
    By mikahell in forum Windows Programming
    Replies: 4
    Last Post: 06-19-2006, 06:50 AM
  2. add source files to embedded VC 4.0
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 03:28 AM
  3. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 04:45 AM
  4. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 10:46 AM
  5. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 01:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21