たとえば、入力test \n testして、このコードを使用して記述しようとすると、
FILE *f = fopen(file, "w+");
fflush(f);
if (f==NULL) {
    //perror(f);
    return 0;
}
else{
    int i = fprintf(f, "%s", text);
    if (i>0) {
        fclose(f);
        return  1;
    }
    else{
        fclose(f);
        return 0;
    }
}
そしてこれを使ってそれを読んでください
FILE *f = fopen(file, "r");
static char c[100000];
const char *d;
if (f!=NULL) {
    if (fgets(c, 100000, f) !=NULL){
        d = c;
    }
    else{
        d = "No text";
    }
}
else{
    /*
     char *ff = f;
     perror(ff);
     */
    d = "File not found";
}
fclose(f);
return d;
読み取りと書き込みのみを行い、改行はtest行いません。なぜこれが機能しないのですか?testtest