0
I need a constructor for a class that has char vectors as attributes, like this one:
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 don’t know how it should look in the builder actually, 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 not right, as I should do?
Why not simplify and use
std::string
since it is c++ ?– Isac
@Isac ah, because can you simplify it? : P
– Maniero