#include <iostream>
using namespace std;
void fun (char *s, int a, double f)
{
/**********found**********/
FILE * fp;
char ch;
fp = fopen("filel.txt", "w");
fprintf (fp, "%s%d%f\n", s, a, f);
fclose(fp);
fp = fopen("filel.txt", "r");
printf("\nThe result:\n\n");
/**********found**********/
while (!feof ( fp )) //或者是 ch != EOF
{
/**********found**********/
ch = fgetc(fp);
putchar( ch );
putchar('\n');
}
fclose(fp);
}
int main( )
{
char a[10] = "hello!";
int b = 12345;
double c = 98.76;
fun(a, b, c);
return 0;
}