Sie sind auf Seite 1von 1

#include<stdio.

h>

int main(){
FILE *fp;
fp = fopen("text.txt", "r+");

char str1[10], str2[10], str3[10], str4[10];


int year;

fscanf(fp, "%s %s %s %s %d", str1, str2, str3, str4, &year);


printf("%s %s %s %s %d\n", str1, str2, str3, str4, year);

///rewind(fp);

scanf("%s %s %s %s %d", str1, str2, str3, str4, &year);


printf("%s %s %s %s %d", str1, str2, str3, str4, year);
fprintf(fp, "%s %s %s %s %d", str1, str2, str3, str4, year);

fclose(fp);
}

Das könnte Ihnen auch gefallen