Results 1 to 2 of 2

Thread: file streams

  1. #1

    Thread Starter
    Addicted Member DarkMoose's Avatar
    Join Date
    Jul 2000
    Location
    in a box
    Posts
    185

    file streams

    Why doesn't this work:

    #include <fstream.h>

    ifstream quoteFile("C:\windows\desktop\quote.txt");

    The error message basically says that it doesn't like the '\w' or the '\d' or '\q'. so how am i supposed to tell it what directory the file is in...
    To understand recursion, one must first understand the concept of recursion.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    since '\' indicates an escape character, you have to escape it as well. Try...
    Code:
    #include <fstream.h> 
    
    ifstream quoteFile("C:\\windows\\desktop\\quote.txt");
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width