OK, I just changed it for this:
It works fine (it creates a text file and outputs the value of 'buf' to it) but I get a warning:
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.
Is it still OK to use the fopen() function, or is it likely to cause problems?
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'