I need a constructor for a class that has char vectors as attributes, like this:
class Anthem {
private:
int Id;
char Name[50];
char Country[50];
int Year;
char Composer[30];
char Historic[200];
public:
Anthem(int id, char name[50], char country[50], int year, char
composer[30], char historic[200]);
~Anthem();
}
But I do not know how to stay in the de facto builder, I did so:
Anthem::Anthem(int id, char* name, char* country, int year, char* composer,
char* historic) { // @suppress("Class members should be properly initialized")
Id = id;
Name = name;
Country = country;
Year = year;
Composer = composer;
Historic = historic;
}
But it's not right, how should I do it?