首页 > 解决方案 > Is it possible to write fopen(), fscanf() or fprintf() functions using only C?

问题描述

I have no issues with the library functions. I know that they work well. I am interested in their implementation. My question is: Can I write working versions of these functions for Windows x64 using only C?

标签: c

解决方案


Many of the stnadard library functions are written in C, and fopen, fread etc. are no exception. You can write a wrapper around open, read, write etc. which are usually lower level functions.

If those are not available, you can also do the same, calling the respective OS functions and wrapping them with your own implementation, you just have to make sure that they are complying to the standard.

Just as an example you can find a source for fopen here.


推荐阅读