c++ read doesn't work
<p>code l6.h</p>

<pre><code>#include &lt;string&gt;
#include &lt;fstream&gt;
#include &lt;iostream&gt;
#include &lt;iomanip&gt;
using namespace std;

struct data
{
    int mt;                 //metai
    int men;                    //menesis
    int die;                    //diena
};

struct sarasas                  //sakos
{
    int pg;                     //pagamintas kiekis
    int ka;                     //kaina
    data dt;                    //data

};

struct SarV
{
    sarasas duom;
    SarV *sekV;
};

class Detale
{
private:
    SarV *p, *d;                                //saraso padzia
public:
    Detale():p(NULL) {}
    ~Detale() {};                       //destruktoriuis
    void Pradzia(){d = p;}
    bool Pabaiga(){return d == NULL;}
    void Kitas(){d = d-&gt;sekV;}
    void Imti(sarasas &amp;st){ st = d-&gt;duom;}
    void Papildyti(sarasas st ){
        SarV *d = new SarV;                 //saka papildoma nauju elementu
                    d-&gt;duom = st;
                    d-&gt;sekV = p;
                    p = d;
                                }
};
</code></pre>

<p>l61.h file</p>

<pre><code>#include &lt;string&gt;
#include &lt;fstream&gt;
#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include "l6.h"

using namespace std;

struct kamienas
{
    string deta;                //Kamieno detale
    Detale sar;             //sakos padzios rodykle
    kamienas *kitas;
};

class Sak
{
private:
    kamienas *pr;               //saraso pradzia
    void SpausdintiSaka(ofstream &amp;fr, Detale &amp;sar);
public:
    Sak() {pr =NULL;}
    ~Sak();
    void Skaityti(ifstream &amp;fd);
    void Spausdinti(string fv);
};
</code></pre>

<p>l61.cpp file</p>

<pre><code>#include "L61.h"

Sak::~Sak(){}

void Sak::Skaityti(ifstream &amp;fd)
{
    string dt,eil; char pabaiga[30];// int kiekis, kaina, metai, menuo, diena;                          //detalei saugoti
    bool baigti= false;
    getline(fd, dt);                            //skaitomas detales pavadinimas
    fd.ignore(80, '/n');
    kamienas *d = new kamienas;                 //naujas saraso elementas
    d-&gt;deta = dt;
    d-&gt;kitas = pr;
    pr = d;
    while (!baigti)                             //skaitomaas vienas dokumentas
    {   
        fd.get(pabaiga, 15);
        eil=pabaiga;
        if(eil == "***")
        {
            baigti = true;
        }
        else
        {
            sarasas st;
            fd &gt;&gt; st.pg&gt;&gt; st.ka &gt;&gt; st.dt.mt &gt;&gt; st.dt.men &gt;&gt; st.dt.die;
            pr-&gt;sar.Papildyti(st);
        }
        fd.ignore(80, '\n');
    }
} 



void Sak::Spausdinti(string fv)
{
    ofstream fr(fv.c_str(), ios::app);
    for (kamienas *d = pr; d != NULL; d = d-&gt;kitas) 
    {
        fr &lt;&lt; "Detale: " &lt;&lt; d-&gt;deta&lt;&lt; endl;
        SpausdintiSaka(fr, d-&gt;sar);
    }
}
void Sak::SpausdintiSaka(ofstream &amp;fr, Detale &amp;sar)
{
    sarasas d;
    for(sar.Pradzia(); !sar.Pabaiga(); sar.Kitas())
    {
        sar.Imti(d);
        fr &lt;&lt; d.pg &lt;&lt; "vnt. " &lt;&lt; d.ka &lt;&lt; "Lt  " &lt;&lt; d.dt.mt&lt;&lt;" "&lt;&lt;d.dt.men&lt;&lt;" "&lt;&lt;d.dt.die&lt;&lt;" data"&lt;&lt;endl;
    }
    fr&lt;&lt;"-------------------------\n";
}
</code></pre>

<p>and main()</p>

<pre><code>#include &lt;string&gt;
#include &lt;fstream&gt;
#include &lt;iostream&gt;
#include "L61.h"

using namespace std;
const string CDfv = "duomenys.txt";
const string CRfv = "rezultatai.txt";
void IvestiDokumentuDuomenis(Sak &amp;sakotas,string fv);
int main()
{
    ofstream fr(CRfv.c_str());
    fr.close();
    Sak s;                          //objektas su sakotu sarasu
    IvestiDokumentuDuomenis(s,CDfv);
    s.Spausdinti(CRfv);
    return 0;

}

void IvestiDokumentuDuomenis(Sak &amp;sakotas,string fv)
{
  ifstream fd(fv.c_str());
  int n = 1;
  while (!fd.eof()) {
      sakotas.Skaityti(fd);
    cout &lt;&lt; "Perskaitytas " &lt;&lt; n &lt;&lt;"-asis dokumentas\n";
    n++;
  }
  fd.close();
}
</code></pre>

<p>I want to get the first line of duomenys.txt file: "varztas", but if I do this with these lines in l61.cpp:</p>

<pre><code>getline(fd, dt);            
fd.ignore(80, '/n'); 
</code></pre>

<p>my program doesn't work, but if I comment this line, program works, but doesn't write title of "varztas".</p>

<p>duomenys.txt file looks like</p>

<pre><code>Varztas 
30 200 2000 01 03
***
</code></pre>

<p>So I need that Varztas will put in mass.</p>

<p>Sorry for my English.</p>
