1.
I know that in an ad you can initialize an array of structures. For example:
struct BusStruct
{
string registration_number;
string route;
};
struct BusStruct BusDepot[] =
{
{ "ED3280", "70" },
{ "ED3536", "73" },
{ "FP6583", "74A" },
};
If the structure is changed into a class, for example:
class BusClass
{
protected:
string m_registration_number;
string m_route;
public:
};
Is it possible to do the same as for the structure (i.e., declare and initialize an array of classes at the same time)?
2. Do I believe that it is impossible to declare and initialize, vector<BusStruct>or vector<BusClass>at the same time?
source
share