I have seen this annoying question again and again. Could you please share your knowledge that might help us to find the answer.
My confusion is that, forward-slash is posix standard but directory structure of operating systems are different.
Thank you
(e.g. the string you would pass to std::fstream:open() to open a file.)
A. "::directory:file.bin"
B. "C:/Directory/File.bin"
C. "/directory/file.bin"
D. "C://Directory//File.bin"
E. std:fstream file paths are not portable.
E : not portable, i.e. implementation defined
Answer can be found in the std::fopen
docs: (which are referred to by fstream via filebuf::open)
Notes
The format of filename is implementation-defined, and does not necessarily refer to a file (e.g. it may be the console or another device accessible through filesystem API). On platforms that support them, filename may include absolute or relative filesystem path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With