given class with field const char* filename;
so that the name of the class is for example MyClass.
#include <cstring>
class MyClass{
const char* filename;
public:
MyClass(const char* name);
};
How can I initialize the field filename
by name
?
NOTE: I must do it with strcpy
function.
Is there a way to do this with a initialization list?
Aucun commentaire:
Enregistrer un commentaire