fprintf(file, "Hellow");
fputs("Hellow", file);
The results of these two seem to be the same.
I don’t know in what situations these are used differently and what the differences are in execution.
Only the result values of the two are the same and I can’t figure it out anymore.
I solved it thanks to your help. Thank you.
>Solution :
fprintf provides you with the ability to format strings(like printf), while fputs just outputs the string straight to the file handle stream you give it.
This is how they are normally used:
fprintf(file_handle, "this is a number: %d", 10);
fputs("hi", file_handle);
Some good references for these functions are(do some research before asking!):
https://www.tutorialspoint.com/c_standard_library/c_function_fputs.htm
https://www.tutorialspoint.com/c_standard_library/c_function_fprintf.htm