How to initialize a vector in a class

  c++, class, vector

Need help to initialize values in default constructor

 class A{
     private:
        string name;
        int age;
        int id;
     public:
         A(string name,int age,int id);
         int getAge(); 
         int getId();
   
    }

    class B{
     private:
        vector <A> a;
        int total;
        int length;    
     public:
         B();
         int getTotal(); 
         int getLength(); 

    }

How to initialize the vector variable of class B in the default constructor B?

Source: Windows Questions C++

LEAVE A COMMENT