[Solved] how to pass a class object as parameter


Yes it is possible to pass an object as a parameter.

class list {

      //some functions

};

list merge(const list& l1, const list& l2)
{
  list mergedList;
  //logic to merge l1 and l2 and copy it to mergedList
  return mergedList;
}

int main()
{
     list   LL1;
     list   LL2;

     list mergedList = merge(LL1, LL2);
}

4

solved how to pass a class object as parameter