Calling constructor of one object in another class constructor

后端 未结 0 954
悲&欢浪女
悲&欢浪女 2021-01-30 10:01

I need to have classes of the following structure in C++.

class A
{
   int y;
   A(int x)
   {
      //Computes y as per x. 
   }
};

class B
{
    A obj;
    int         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题