Comments

:i have the following codes for concating many binary files into single file.but it is showing some error which i am not able to understand.

What error is it showing?

:is it possible to make a function which calculates the size of the file and can i call that function each time time i require in main??

There's a lot of duplicated code, I'd make a function that does the reading and writing and just call that individually for each file. That should reduce the amount of code significantly. You can open the write file in main and pass the pointer to that file along with a filename to this function. The function could then open the file indicated by the filename and go through the reading/writing and all of that.