My questions is, suppose we have two classes A and B. I want to have an object of B in class A.
Should I use,
class A { public: A();
Use the second, try to avoid using new as much as possible in C++ unless you are using RAII.
new