简体   繁体   中英

Visual Studio 2012 File Input

I am looking for a way to have a file entered by the user to be used in a program that I have created in C++. When in project mode, this works fine, but when just using the executable program, my program seems to be unable to locate a file entered by the user (even through paths). Is there something in properties that I need to adjust? Also, I've read how to link files to the program, but since the user will be entering there own file name, I would like this to not be restricted to files that are known.

Any suggestions would be greatly appreciated!

When you execute the program outside your IDE, put that file beside the .exe file. If you want your program works simultaneously in two modes, you can use absolute path .

IDE's way is to change working directory where it's in PROJECT > Properties > Debugging > Working Directory. Change it to where your .exe file is. A directory with name Debug or Release.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM