Thread: fstream help!

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    44

    fstream help!

    How can i specify a path for the text file i want to use to save or load data?

    something like this?
    ofstream outFile("C:\text.txt");
    cause when i do that, outFile == false...

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    You probably don't have a tab character (\t) in your filename. To get an actual backslash in a string literal you need two \\ in a row.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    44
    oh i didnt notice that while writing xD
    thank you!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Fstream. I/O
    By kevinawad in forum C++ Programming
    Replies: 2
    Last Post: 07-07-2008, 09:19 AM
  2. using fstream
    By swgh in forum C++ Programming
    Replies: 1
    Last Post: 02-11-2006, 04:53 AM
  3. ARGH! fstream errors
    By OttoDestruct in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2004, 10:37 PM
  4. Are fstream and ofstream incompatible?
    By johnnyd in forum C++ Programming
    Replies: 5
    Last Post: 03-19-2003, 12:21 PM
  5. Problems with fstreams.
    By mosdef in forum C++ Programming
    Replies: 7
    Last Post: 06-19-2002, 03:36 PM