title: How to fix any errors
body: <p>error: no match for ‘operator[]’ (operand types are ‘structTicket’ and ‘int’)
      WriteTicket(file,masstickets[i]);</p>
  
  <pre><code>   bool WriteTickets(structTicket &amp; masstickets, int count, const string filepath)
      {
          bool written = false;
          ofstream file(filepath);
          if(file)
          {
              file &lt;&lt; count &lt;&lt; endl;
              for (int i = 0; i &lt; count; ++i)
                  WriteTicket(file, masstickets[i]);
              file.close();
              written = true;
          }
          return written;
  }
  </code></pre>
  
  <p>and here : 1-2.cpp:136:31: error: invalid initialization of reference of type ‘structTicket&amp;’ from expression of type ‘structTicket*’
     bool written = WriteTickets(masstickets ,count ,FilePath);</p>
  
  <pre><code>int main()
  {
      structTicket * masstickets;
      int count;
      bool read= ReadTickets(masstickets, count, FilePath);
      if(read)
      {
          cout&lt;&lt; "Файл" &lt;&lt; FilePath&lt;&lt; "прочитан."&lt;&lt;endl;
          cout&lt;&lt; "-----------------------------------------------" &lt;&lt;endl; 
          WriteTicketsToTable(masstickets, count);
          bool written = WriteTickets(masstickets ,count ,FilePath);
          if(written)
              cout&lt;&lt; "Файл" &lt;&lt; FilePath &lt;&lt; "записан." &lt;&lt;endl;
          else
              cout&lt;&lt; "Файл" &lt;&lt; FilePath &lt;&lt; "Не записан. "&lt;&lt;endl;
          cout&lt;&lt; "-----------------------------------------------" &lt;&lt;endl;
  </code></pre>