fstream::is_open Cant open file

I am new to programming and trying to write a program that writes strings to a text file. I am using fstream::is_open to display the error message Can't open file if the file doesn't open. My code runs fine in Visual C++ Express but when I try to run it from the executable it shows Can't open file. Can anybody tell me what the problem is and how to fix it? Also, I am new to the forums is there a way I can tell if this question or something similar was previously posted?
You could use the search bar. I think your problem is that the file you are trying to open isn't where you think it is. Make sure either you have a direct path or it is in the same directory as the .exe.
Thanks firedraco. I didn't realize they were not in the same directory. I moved them to the same directory and that fixed the problem.
Topic archived. No new replies allowed.