Download MetaTrader 5
To add comments, please log in or register
Publish your trading signal. Gain access to millions of traders!
bucket
38
bucket 2015.10.02 07:52 

I like to create a file handling class. It would be nice if some member functions could have the same names like the normal file handling functions, i.e. FileWrite, FileRead. But a class would always call the member functions with that name and it would not be possible to call the normal functions.

Is there something like a namespace „system“ or something similar, to call the normal file functions?


An example:


Class x

{

private:

  void   SyncToCloud();

public:

        x();

        ~x();

  void   FileWrite();

  void   FileRead();

};


None of the member functions would be able to call FileWrite(), because the class would search for a member function with that name. If member function x::FileWrite() would call FileWrite() a recursive call would occur and maybe an endless loop.

whroeder1
13619
whroeder1 2015.10.02 12:16  

The member function is x::FileWrite() which is how you call outside a member function it if it was a static function.

The global function is ::FileWrite()

/
To add comments, please log in or register