#include<stdio.h>
int main()
{
FILE* f;
f=fopen("book.txt","w");
char* sentence="0123456789";
fprintf(f,"%s\n",sentence);
fseek(f,0,SEEK_END);
int a=ftell(f);
printf("%d\n",a);
fclose(f);
return 0;
}
上記のコードを実行すると 12 が出力されます。12 ではなく 11 (0,1,2,3,4,5,6,7,8,9,\0) ではないのはなぜですか?
編集済み: (0,1,2,3,4,5,6,7,8,9,\r\n)