I want to check if a given file can be read. I am using following code snippet:
std::string fullPath("/test/text.txt");
std::ifstream stream(fullPath.c_str());
if (stream.good())
{
//File can be read
}
Above piece of code is working fine for me. My requirement changes a little where input in const wchar_t*
instead of std::string
. What changes do I need to do in order to make this piece of code work for me?