Ver Mensaje Individual
  #2  
Antiguo 30-07-2023
Avatar de escafandra
[escafandra] escafandra is offline
Miembro Premium
 
Registrado: nov 2007
Posts: 2.197
Reputación: 20
escafandra Tiene un aura espectacularescafandra Tiene un aura espectacular
Tanto TFileStream::Write como TFileStream::Read admiten como primer parámetro un puntero y tu le pasas un entero. No compila.


Esta es la solución:
Código PHP:
file->Write(&Matriz[i][j], sizeof(int)); 

Ten en cuenta que será más eficiente si haces:
Código PHP:
  TFileStream *file = new TFileStream(NomArchfmCreate);
  
// WRITE
  
for(int i 03i++){
    for(
int j 0100j++){
      
Matriz[i][j] = j;
    }
    
file->Write(Matriz[i], 100*sizeof(int));
  }
  
delete file;  // NO TE OLVIDES DE DESTRUIR TU OBJETO
//*****************************
  
  // READ
  
TFileStream *file = new TFileStream(NomArchfmOpenRead);
   for(
int i 03i++){
    
file->Read(Matriz[i], 100*sizeof(int));
  }

  
delete file;   // NO TE OLVIDES DE DESTRUIR TU OBJETO 



Saludos.
Responder Con Cita