Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 2nd, 2012  |  syntax: None  |  size: 0.22 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to create a function to save outputs to a text file?
  2. void save (char * filename)
  3. {
  4.     FILE *output = fopen (filename, "w");
  5.     fprintf (output, "This is a test message");
  6.     fclose(output);
  7. }
  8.        
  9. save("outfile.txt");