OK, I just changed it for this:
Code:
FILE * pFile;
pFile = fopen("file.txt","w");
fwrite (buf , 1 , sizeof(buf) , pFile ); // 'buf' is a char* which takes its value from a text box that the user types into.
fclose (pFile);
It works fine (it creates a text file and outputs the value of 'buf' to it) but I get a warning:
Code:
warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(237) : see declaration of 'fopen'
Is it still OK to use the fopen() function, or is it likely to cause problems?