#include<stdio.h>
size_t fileSize(const char* fileName);
int main()
{
size_t size = fileSize("VIP13.txt");
printf("size %u", size);
return 0;
}
size_t fileSize(const char* fileName)
{
FILE* fp = fopen(fileName, "r");
if (!fp)
{
return ~0; //0000 0000 1111 1111
}
fseek(fp, 0, SEEK_END);
size_t size = ftell(fp);
fclose(fp);
return size;
}