Passing a structure handle (converting C to C++ OOP) -
Can you suggest in a way how I can "handle (* h)" inside an object Am I This way my code c. Looks like
int open (const char * name, ini_file_t **); Read int (ini_file_t * h, const char * sn, const char * kn, int *); Write int (ini_file_t * h, char * sn, char * kn, int); Int ini_file_close (ini_file_t * h); I'm trying to delete it (+ h) in C ++.
XTextFile {public: int open (const char * name); Read int (const char * sn, const char * kn, int *); Write int (four * sn, four * cube, int); Int ini_file_close (); }; Can you share some suggestions about how I can do this?
Or am I on the right track when doing this in OP?
This will be my explanation:
class XTextFile {Public: XTextFile (const std :: string and name); // Constructor opens () ~ XTextFile (); // replaces destructor ini_file_close int (const std :: string and sn, const std :: string & kn, int *); Write int (four * sn, four * cube, int); // Not sure what these parameters are, but they should probably have some study :: string; C ++ consultants are used to initialize an object, and a destructor cleans up its resources when it is free. You will use this object in this way:
some functions to zero () {XTextFile txt ("c: \\ filename.txt"); Txt.read (....); // txt automatically closes when it gets out of the scope}
Comments
Post a Comment