#include <stdio.h>

void main() {
    char array[256];
    FILE* read_f = fopen("./sample.txt", "r");
    if(read_f == NULL){
        printf("Failed to open the file\n");
        return;
    }
    FILE* write_f = stdout;

    int b = 1;

    while (b > 0) {
        b = fread(array, 1, 255, read_f);
        fwrite(array, 1, b, write_f);
    }

    // maybe need fflush(write_f);
    fclose(read_f);
}