輸入.txt:
File entry structures:
[0] "" 0 -1
[1] "" 0 -1
[2] "" 0 -1
[3] "" 0 -1
[4] "" 0 -1
我想創建一個新檔案(output.txt)。C 程式將第一次出現的“”替換為“Testfile”,所以它看起來像:
輸出.txt:
File entry structures:
[0] "Testfile" 0 -1
[1] "" 0 -1
[2] "" 0 -1
[3] "" 0 -1
[4] "" 0 -1
到目前為止我的作業:
#include <stdio.h>
int main() {
FILE *input_file, *output_file;
int size, fblock;
char index[81];
char name[81];
input_file = fopen("input.txt", "r");
output_file = fopen("output.txt", "w");
// ignore "File entry structures:" line when reading/writing
while (fscanf(input_file, "
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/493606.html
