copying item of list into other list

Hi,

It's part of a program that needs to get its data from csv files, I read the data into vectors which I then put in a list. I manage to edit entries, delete rows (i.e. the vectors), but I seem to be unable to copy the row (vector) from a csv into another list.
Could you please help me?

The csvFile class contains functions to read the data from the file, the list of vectors which contain the actual data and a function to print the list on the screen.
The EditedString class is a subclass of the string class (adds some extra features to split strings)

(PS: I'm not that good at using pointers)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
int main()
{
...
std::list<std::vector<EditedString> > * vectorlist;
verplaats(gsm, vectorlist);
...
}

void verplaats(csvFile * csvIn, std::list<std::vector<EditedString> > * lijstIn)
{
    int row;
    std::cout << "\nWhich row\t"; std::cin >> row;
    row=row-1;

    std::list<std::vector<EditedString> >::iterator it = csvIn->vectorlist.begin();

    int count;
    while(teller!=row)
    {
        count++;
        it++;
    }

    lijstIn->push_back(*it);     //Problem is here!!!

    csvIn->vectorlist.erase(it);

    csvIn->show();
the problem is on line 4. You have a pointer but no object to point to:
1
2
std::list<std::vector<EditedString> > vectorlist; // Note: no *
verplaats(gsm, &vectorlist); //Note: add & 
Thank you very much, I don't know how to initialize that sort of object, I think I only know how to declare it, but I am going to look into it :).
Thanks again!
Topic archived. No new replies allowed.