如何创建一个继承FILE方法的类

How can i create a class that inherits the methods from FILE

本文关键字:FILE 继承 一个 方法 何创建 创建      更新时间:2023-10-16

如何扩展FILE类以使用其方法?换句话说,我如何使用默认FILE对象提供的所有函数,并且仍然具有模拟实际函数的相同功能?

class myFile
{
   File *_f;
public:
   myFile(File *f){ /*open the file here, then make _f=f;*/ };
   virtual ~myFile(){ /*close the file here*/ };
   // and can add more methods here
}