Нужна помощь, чтобы понять вывод этого кода

см. Мой код

#include <stdio.h>
#include<stdlib.h>
#include<sys/stat.h>
int main(int argc, char**argv) {

    unsigned char *message = NULL;

    struct stat stp = { 0 };
    stat("huffman.txt", &stp);
    /*determine the size of data which is in file*/
    int filesize = stp.st_size;
    printf("\nFile size id %d\n", filesize);

    FILE* original_fileptr = fopen("huffman.txt", "r");
    message =  malloc(filesize);
    fread(message, 1, filesize, original_fileptr);
    printf("\n\tEntered Message for Encode is %s= and length %d", message,strlen(message));

    return 0;
}

здесь huffman.txt имеет размер 20 байт и следующий символ там

άSUä5Ñ®qøá "F„ œ

вывод этого кода теперь

File size id 20

        Entered Message for Encode is ά­SUä5Ñ®qøá"F„œ= and length 21

вопрос в том, если размер 20, то почему длина 21?

0
задан Jeegar Patel 31 October 2011 в 18:54
поделиться