CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2009
    Posts
    12

    the system cannot find the file specified

    Code:
    ifstream infile;
    
    infile.open("input.txt");
    I have the file saved in my project directory. What could be the problem.

  2. #2
    Join Date
    Feb 2005
    Posts
    2,160

    Re: the system cannot find the file specified

    The program runs from the Debug or Release folder.

  3. #3
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: the system cannot find the file specified

    ...or any other directory that may have been set as current.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  4. #4
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: the system cannot find the file specified

    With GetCurrentDirectory you can see what your path is.

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: the system cannot find the file specified

    ... and to make you life more simple and secure always use the full path name for your files
    Victor Nijegorodov

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

Featured