How to get the file size in C language

How to get the file size in C language
/*
get file size in c language
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/unistd.h>

int main(){
    FILE *fp = fopen("test.txt", "r");
    fseek(fp, 0L, SEEK_END);
    int size = ftell(fp);
    printf("file size: %d",size);
    return 0;
}
Source‮:‬www.lautturi.com
Created Time:2017-08-29 04:43:16  Author:lautturi