I use Visual C++ 6.0. My source is below. I want to write text file which can read-only. If you know how to edit source to do that ,please tell me. Thank you very much.
#include <stdio.h>
int main()
{
FILE *outp;
char *output_filename;
output_filename = "output.txt";
outp = fopen(output_filename, "w");
fprintf(outp, "1");
fprintf(outp, "\n");
if (output_filename)
{
fclose(outp);
}
}
PS. I really want to create logfile but I do not know how to do.So I create text file instead. Does text file (read-only) and logfile have much difference?