input file not opening?

Okay, I've never really had a problem with anything like this before, but I can't seem to get my input file to open. I thought maybe it was because I was working directly from my flash drive, but I recreated the project on my HD and it's still not working. I even tried restarting my computer. Can anyone help? I took a screenshot of my code, a debug run, and the input file properties to show that the file exists.

http://www.boardersla.com/inputfilenotopening.jpg

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <fstream>
#include <list>
using namespace std;

void main()
{
	ifstream ifs;

	ifs.open( "C:\\Users\\bdubc\\Desktop\\Project 5 Part 2\\input.txt" );
	if( ifs.is_open() )
		cout << "Open" << endl;

	else
		cout << "Error: Could not open input file" << endl;
}
I don't know if it's a problem but you could try using a path without spaces.

The image doesn't work.
Topic archived. No new replies allowed.