Given this piece of code:
#include
(void) someFunction(void) {
list l;
l.push_back(1);
}
A return function is declared like this : list
.
Check that values with list
.
Like this :
#include
#include
using namespace std;
list someReturnFunc(int listSize)
{
list myList;
for (int g=0; g< listSize; g++) myList.push_back(g);
return myList;
}
int main ()
{
list yourList;
list::iterator i;
yourList = someReturnFunc(15);
for(i=yourList.begin(); i != yourList.end(); ++i) cout << *i << " ";
cout << endl;
return 0;
}