0
class P
{
public:
    int x,y,z;
    P(int x,int y,int z)
    {
        this->x=x;
        this->y=y;
        this->z=z;
    }
};
class A
{
public:
    vector<P>p;
   // p.push_back(P(1,2,3));
};

Is there any association relation between class P and class A since vector is of class type?

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
PARTH
  • 1
  • 1
  • 3
    its composition not association – 463035818_is_not_an_ai Nov 09 '22 at 14:54
  • 1
    See dupes: [What is the difference between association, aggregation and composition?](https://stackoverflow.com/questions/885937/what-is-the-difference-between-association-aggregation-and-composition) and also this: [C++ : Association, Aggregation and Composition](https://stackoverflow.com/questions/25779394/c-association-aggregation-and-composition) – Jason Nov 09 '22 at 14:58
  • What's written in comments cannot be put there. If you plan to remove the comments prefix `//`, you better have to remove the whole comment. Instructions need to be written inside a function. – Fareanor Nov 09 '22 at 14:59

0 Answers0