fgetpos() goes with fsetpos(). And ftell() goes with fseek().
fgetpos() looks practically like ftell() because both take a FILE* parameter, and both return some kind of position in the file, albeit with a slightly different style. But get this: ONLY fseek() allows you to seek from the beginning of the file, from your current position in the file, and backwards from the end of the file (the third argument to fseek() being SEEK_SET, SEEK_CUR, and SEEK_END). fsetpos() doesn't do this. fsetpos() is limited to going back to some position you got from fgetpos().
Let us say you want to read a file into memory. How much heap do you need from malloc()? You need the size of the file. And I have yet to find any function in the C Standard Library that will tell you the size of a file, though some C Compilers may add a non-standard function. For example, Borland Turbo C had filelength(). But I have not seen filelength() amongst the STANDARD C Library.
So, what you can do is use fseek() to 0 bytes before the END of the file. Then use ftell() to get the position in bytes, and base your calculation for amount of heap memory on that.
What else could you do to get the file size? You could use fgetc() to read each character, counting until you get to the end. But I think using fseek() and ftell() is better and easier.