Ask a Question

 

Start Coding Today

   

GeeksQuiz

GeeksforGeeksIDE

Data Structures

Algorithms

Interview Experiences

C Programming

C++ Programming

Java Programming

GATE CS

Books

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

Please log in or register to answer this question.

...