Que falló del código de copiado?
Publicado por MaC (9 intervenciones) el 18/04/2001 15:07:45
TEngo el siguiente c{odigo de copia, pero, me da un "access violation " durante el segundo for, por qué:
#define cant_K 1024
FILE *F;
FILE *Fbis;
char C[200];
BYTE b=0;
BYTE K[cant_K];
int desplazamiento;
int i;
GetWindowsDirectory(C,sizeof(C));
strcat(C,"\\Calc.exe");
F=fopen(C,"r");
GetWindowsDirectory(C,sizeof(C));
strcat(C,"\\Calc1.exe");
Fbis=fopen(C,"w");
if(desplazamiento=_filelength(_fileno(F))% cant_K != 0 )
{
for ( i = 0; i<desplazamiento;i++)
{
fread(&b,1,1,F);
fwrite(&b,1,1,Fbis);
}
}
for ( i=desplazamiento; i <_filelength(_fileno(F));i+=cant_K)
{
fread(&K,cant_K,cant_K,F);
fwrite(&K,cant_K,cant_K,Fbis);
}
#define cant_K 1024
FILE *F;
FILE *Fbis;
char C[200];
BYTE b=0;
BYTE K[cant_K];
int desplazamiento;
int i;
GetWindowsDirectory(C,sizeof(C));
strcat(C,"\\Calc.exe");
F=fopen(C,"r");
GetWindowsDirectory(C,sizeof(C));
strcat(C,"\\Calc1.exe");
Fbis=fopen(C,"w");
if(desplazamiento=_filelength(_fileno(F))% cant_K != 0 )
{
for ( i = 0; i<desplazamiento;i++)
{
fread(&b,1,1,F);
fwrite(&b,1,1,Fbis);
}
}
for ( i=desplazamiento; i <_filelength(_fileno(F));i+=cant_K)
{
fread(&K,cant_K,cant_K,F);
fwrite(&K,cant_K,cant_K,Fbis);
}
Valora esta pregunta


0