汉字在计算机内部的内码是占2个字节的。
#include<stdio.h>
#include<stdlib.h>
int main()
{
FILE *fp;
char string[21];
if((fp=fopen("E:\\c.txt","rt"))==NULL)
{
printf("\nOpen error!\n");
exit(0);
}
fgets(string,21,fp);
printf("\n%s\n",string);
fclose(fp);
fp=NULL;
return 0;
}
而所打开的文件里的内容却远远不止这些