How do I make the working directory the “solution directory” but not through the properties, but through the code?
I’m working in windows.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you mean you want to find the directory that has a .sln file in it and work with it, there is no concept in C++ of such a thing as a .sln or a Makefile, or anything else really that was used in the build process to compile your project.
The concept is that you are building machine code to run without a specific runtime environment, although it may need to find other libraries at runtime.
You could hard-code the path in, or the name of the .sln file and then let your program search the filesystem for it in case it finds it, but that’s just about all.