GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

How to pass pointer to a list to a function?

int v;
list<int> *adj;    //ptr to a list
adj=new list<int>[v];     //array of pointers
while(m--){
		cin>>x>>y;
       adj[x].push_back(y);
	}
.
.
.
.
   foo();  //i want to pass the above list to this function.How do I?


}

 void foo()// also how to catch these arguments?
{

}

 

asked Jan 16 by nb
...