What is the simplest way to get the file name that from a path?
string filename = \"C:\\\\MyDirectory\\\\MyFile.bat\"
In this example, I s
If you can use boost,
#include
path p("C:\\MyDirectory\\MyFile.bat");
string basename = p.filename().string();
//or
//string basename = path("C:\\MyDirectory\\MyFile.bat").filename().string();
This is all.
I recommend you to use boost library. Boost gives you a lot of conveniences when you work with C++. It supports almost all platforms.
If you use Ubuntu, you can install boost library by only one line sudo apt-get install libboost-all-dev
(ref. How to Install boost on Ubuntu?)