Hello,
Currently I use the following code which works.
However I would like to change it so I can reuse it. I want to be able to pass in a file_path and text_to_writeCode:void file_write (){ FILE *file; file = fopen("c:\\windows\\Temp\\poop\\toadd.txt", "wt"); fprintf (file, "%s", "\nWritten by John"); fclose (file); }
However I don't believe this is the correct way to do it? I get errors. How can I do this?Code:file_write (char[] file_path, char[] text_to_write){ FILE *file; file = fopen(file_path, wt"); fprintf (file, "%s", text_to_write); fclose (file); }



LinkBack URL
About LinkBacks


