首先看下处理之前的代码。其中boya结构体数组用于将数据写入文件,boyb数组用于将文件中的数据读出到boyb
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <bits/stdc++.h>
using namespace std;
struct stu{
char name[10];
int num;
int age;
}boya[2],boyb[2];
int main() {
FILE *fp;
fp = fopen("C:\\Users\\甜甜不哭\\Desktop\\复试\\jdfs\\笔记\\struct.txt","w+");
if(fp==NULL) {
perror("fopen");
return 0;
}
for(int i=0;i<2;i++