var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: how to write the info to text file--> C language
I'm a university first year student, i have some question about the C programing language. My question show below
1)Write a C program to read an integer and a floating point number from the console and write them to a text file called "exercise3.txt"
my solution is
printf("Please enter an integer number\n");
printf("Please enter a floating point number\n");
ofp = fopen("exercise3.txt", "w");
fprintf(ofp, "%d \n %f", i, f);
the exercise.txt file will automatic create, but the value i and f didn't write to the file.... how to solve this
I'd bet you need fclose() to flush the buffer and close the file.
What is the syntax for "fclose()"? Is it the same as fopen()? If so what is the syntax for inside the brackets?
Will appreciate the help.
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
using of Fclose()
using of fclose() function is easy.
where fp is the File pointer.