※スタイルシート未対応ブラウザではレイアウトを正確に再現できません。
  < The returning  contents  advance >   
                   < [modosusu] > Color magazine monochrome light and shade   font predetermined, Gothic Ming-style type longhand   size Konaka large   standard  


  Method of acquiring size of file   

  1. ..clause 1..: I must give the function for that though I want to know the size of the file.

[1] I must give the function for that though I want to know the size of the file.

There is no function to know the size of the file in C language.
Move and request the file pointer to know the size of the file after opening the file.

 
fpos_t GetFileSize(const char *FileName[]) 
{
	fpos_t fsize = 0; 

	FILE *fp = fopen(FileName,"rb"); 
 
	/* The size of the file is 
	investigated */ Fseek(fp,0,SEEK_END);
	fgetpos(fp,&fsize); 
 
	fclose(fp); 
 
	return fsize; 
}
Fpos_t is a variable that means the size of data, and the realities are the integral values without the sign. There is very no problem even if it changes it into int.
Moreover, if the file pointer is not returned to former position when requesting it in the middle of the file manipulation, it becomes a bug.

	fpos_t fsize = 0;
	fpos_t fsizeb =  fseek(fp,0,SEEK_END);
	fgetpos(fp,&fsize);
	fseek(fp,fsizeb,SEEK_SET); 

It returns to contents.


< - Advanced -> to the returning following. the first  that returns