Utility.cpp
Upload User: lczygg
Upload Date: 2007-07-03
Package Size: 2947k
Code Size: 1k
Development Platform:

Visual C++

  1. #include "stdafx.h"
  2. const char strDebugFile[] = "debug.txt";
  3. void ResetLog()
  4. {
  5. FILE * fp = fopen( strDebugFile, "wt");
  6. fprintf(fp, "nnstart logging:nn");
  7. fclose(fp);
  8. }
  9. void Log(char *string)
  10. {
  11. FILE * fp = fopen( strDebugFile, "at");
  12. if (fp != NULL)
  13. {
  14. fprintf( fp, string);
  15. }
  16. fclose(fp);
  17. }
  18. void Log(char *string, char *p1)
  19. {
  20. FILE * fp = fopen( strDebugFile, "at");
  21. if (fp != NULL)
  22. fprintf( fp, string, p1);
  23. fclose(fp);
  24. }
  25. void Log(char *string, int n1)
  26. {
  27. FILE * fp = fopen( strDebugFile, "at");
  28. if (fp != NULL)
  29. fprintf( fp, string, n1);
  30. fclose(fp);
  31. }