balrougelive

Untitled

Aug 8th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #pragma warning(disable : 4996)
  3.  
  4. void main()
  5. {
  6. FILE *fp;
  7.  
  8. // Opening a file for writing
  9. fp = fopen("data.txt", "w");
  10.  
  11. // fprintf work almost exactly like printf
  12. // except the fist parameter is a FILE*
  13. fprintf(fp, "%s", "Blue Ballington\n");
  14. fprintf(fp, "%c\n", 'n');
  15. fprintf(fp, "%d\n", 21);
  16.  
  17. fclose(fp);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment