Hassan Ahmad
Hassan Ahmad

Reputation: 1

STL List using c++ ....in passing array of pointer of list

i am facing problem in passing STL list obj b reference, here is the code using prototype

void input(list<string>& *x[])

declaring in main

list<string> *table[SIZE];
input(table);     //calling

any help would be apprecited.

Upvotes: 0

Views: 685

Answers (1)

Mankarse
Mankarse

Reputation: 40613

Your function is attempting to take a pointer to a pointer to a reference to a list<string>. Your problem is that it is impossible to create a pointer to a reference.

You should instead try making a reference to an array of pointers to list<string>:

void input(list<string> *(&x)[SIZE])

Upvotes: 5

Related Questions