input the in.txt is 1 2 4 5
the result is:6 nonetheless i can't write it on the out.txt
thank you for all appreciated answers
Code:#include <stdio.h> void ad( FILE* fptr_in, FILE* fptr_out); int main(){ FILE *pFile_in; FILE *pFile_out; pFile_in = fopen ("in.txt","r+"); pFile_out = fopen ("out.txt","w+"); fprintf (pFile_out, "%s\n","ad:"); ad(pFile_in, pFile_out); return 0; } void ad( FILE* fptr_in, FILE* fptr_out){ fptr_out=fopen("out.txt","w"); fprintf(fptr_out,"%d",(2+3)); fclose(fptr_out); }