title: Read an object from the file
body: <p>I am making a record of cars using a matrix of pointers from a class of Transport and store it with a file, I enter a special number for a particular car and store it in a file called "type" and store the object in a file called "TransportFilePath" but when I read it reads only the special number without the object</p>
  
  <pre><code> void ProgrammeManagement:: Transport_ Building_Record()
      {
          int x,id,engine_Number,door_Number,num;
          char an;
          double length,speed;
          string transport_Name,company,property_Type,transport_Type;
          tm date;
          static int i = 0;
          fstream file(TransportFilePath,ios::out|ios::binary|ios::trunc);
          fstream filee(Type,ios::out|ios::binary);
          cout &lt;&lt; "how many Cars"&lt;&lt;endl;
          cin &gt;&gt; x;
          Transport **T = new Transport *[x];
          do
          {
              cout &lt;&lt; "Special number: ";
              cin &gt;&gt; num;
              cin &gt;&gt; id;
              cin &gt;&gt; transport_Name;
              cin &gt;&gt; company; 
              cin &gt;&gt; date.tm_yday &gt;&gt; date.tm_mon &gt;&gt; date.tm_year;
              cin &gt;&gt; speed;
              cin &gt;&gt; transport_Type;
              cin &gt;&gt; property_Type;
              cin &gt;&gt; engine_Number;
              cin &gt;&gt; length;
              cin &gt;&gt; door_Number;
              T[i] = new Car(id,transport_Name,company,date,speed,property_Type,transport_Type,engine_Number,length,door_Number);
              filee.write((char*)&amp;num,sizeof(int));
              file.write((char*)&amp;T[i],sizeof(Transport));
              i++;
              cout &lt;&lt; "enter Y input Car";
              cin &gt;&gt; an;
          }
          while ( i &lt;x &amp;&amp; an == 'Y');
          file.close();
          filee.close();
      }
  </code></pre>
  
  <p>But when I want to read from the file, nothing prints on the console screen .</p>
  
  <pre><code>void ProgrammeManagement::read()
  {
      int n;
      Car z;
      fstream fil(Type,ios::in|ios::binary);
      fstream filll(TransportFilePath,ios::in|ios::binary);
      while(fil.read((char*)&amp;n,sizeof(int)))
      {
          cout &lt;&lt; "number : "&lt;&lt;n&lt;&lt;endl;
          while(filll.read((char*)&amp;z,sizeof(Car)))
              z.Print();
      }
      fil.close();
      filll.close();
  }
  </code></pre>