How get file path from std::ifstream in c++
- by Nilesh Shinge
Hi All
I am opening file using C++ function std::ifstream.
I may open file using relative path (file.txt) or absoulte path (C:\test\file.txt).
As I am passing string as file name, dont know whether it is relative or absolute path.
Can any body tell me how to get absolutre path after file has been successfully open using
std::ifstream function.
e.g. std::ifstream file(strFile); // strFile = "file.txt" or strFile = "C:\test\file.txt"
I want absolute path after file open successfully.
Thanks
Nilesh