1.纯C实现
FILE *fp;
if ((fp = fopen("example.txt", "rb")) == NULL)
{
exit(0);
}
fseek(fp, 0, SEEK_END);
int fileLen = ftell(fp);
char *tmp = (char *) malloc(sizeof(char) * fileLen);
fseek(fp, 0, SEEK_SET);
fread(tmp, fileLen, sizeof(char), fp);
fclose(fp);
for(int i = 0; i < fileLen; ++i)
{