#include <stdio.h>
#include <string.h>
int main()
{
char nombre[11] = "pedro.jpg";
FILE *fichero;
long int final;
fichero = fopen( nombre, "r" );
fseek( fichero, 0L, SEEK_END );
final = ftell( fichero );
fseek( fichero, 0L, SEEK_SET );
printf( "Tamaño del fichero \"%s\": %d bytes\n", nombre, final );
if( !fclose(fichero) )
printf( "Fichero cerrado\n" );
else
{
printf( "Error: fichero NO CERRADO\n" );
return 1;
}
return 0;
}