不懂如何利用文件操作复制

问题
利用文件操作 使用代码把bmp.txt的内容复制到lcd.txt中


#include <stdio.h>
#include <stdlib.h>

int main() {
    FILE *bmp_file, *lcd_file;
    char ch;

    // 打开bmp.txt文件
    bmp_file = fopen("bmp.txt", "r");
    if (bmp_file == NULL) {
        printf("无法打开bmp.txt文件.");
        exit(1);
    }

    // 创建lcd.txt文件
    lcd_file = fopen("lcd.txt", "w");
    if (lcd_file == NULL) {
        printf("无法创建lcd.txt文件.");
        exit(1);
    }

    // 从bmp文件中读取字符并写入lcd文件中
    while ((ch = fgetc(bmp_file)) != EOF) {
        fputc(ch, lcd_file);
    }

    // 关闭文件
    fclose(bmp_file);
    fclose(lcd_file);

    printf("bmp.txt文件的内容已成功复制到lcd.txt文件中.");

    return 0;
}

看你用什么语言的代码
如果是 shell,可以用 copy bmp.txt cd.txt