Is there an easy way to get the application name using Boost (maybe with boost::program_options?)
boost::program_options
Everything will be like this:
Having argv[0] = "c:\foo\bar\appname.exe"
argv[0] = "c:\foo\bar\appname.exe"
I want to have var1 = "appname"
var1 = "appname"
You can use boost :: filesystem to extract the name from the path. it will look something like this:
#include <boost/filesystem.hpp> boost::filesystem::path p = argv[0]; std::string var1 = p.stem().string();