CreateFile
vs fopen
vs ofsteam
- advantage & disadvantage?
I heard that CreateFile powerful but only for windows.
Can you tell what should I use ( on windows) and why?
It depends on what you're doing. For sequentially reading and writing text files, iostream is definitely the way to go. For anything involving transactional security or non-standard devices, you'll have to access the system directly (CreateFile
or open
). Even then, for sequential reading and writing of text, the best solution is to define your own streambuf
, and use that with iostream.
I can't think of any context where fopen
would be preferable.
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