Output code from file:

char str_1[80]; FILE *f1; f1=fopen("C:\\text.txt","r"); if (f1==NULL) puts("error"); else { while(!feof(f1)) {fgets(str_1,25,f1); for(int i=0;i<strlen(str_1);i++) { //код обработки { puts(str_1);} fclose(f1); } 

I want to output something like 'Word' = 'Result of processing', and not just the result of processing - str_1 How can I make the initial value of a variable to be remembered?

    1 answer 1

    get another variable, for example char str_0 [80] and call strcpy (str_0, str_1) before the loop, then str_0 will have a string before processing

    • thanks, it helped - gvenog