List Sorting

I need to sort my data. Here are part of my code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
void Branch::Check(string code, int month){
    ofstream rf("Rezultatai.txt", ios::app);
    rf.setf(ios::left);
    SarH *d = pr;
    rf << "Data" << endl;
    while(d != NULL){
        SarV *v = d->prV;
        Print(rf, v, code, month);
        d = d->sekH;
    }
    rf.close();
}

void Branch::Print(ofstream &rf, SarV *prV, string code, int month){
    SarV *p = prV;
    while(p != NULL){
        Books leid = p->duom;
        if(code == leid.code && month == leid.month){
            rf << p->duom.adress << " " << p->duom.name << " " p->duom.code << endl;
        }
        p = p->sekV;
    }
}


All I need to do is sort my list. Is it possible to sort my list if I choose what to print in "Rezultatai.txt" file on Print method?
Topic archived. No new replies allowed.