Forward declare FILE *

前端 未结 6 1822
既然无缘
既然无缘 2020-12-09 17:14

How do I forward declare FILE * in C? I normally do this using struct MyType;, but naturally this doesn\'t appear to be possible.

If behavi

6条回答
  •  被撕碎了的回忆
    2020-12-09 17:43

    FILE* is an opaque type. Thus, this should in theory work.

    typedef struct FILE_impl_but_including_stdio_h_is_best FILE;
    

提交回复
热议问题