filereport.cpp

来自「一个用vc做的挖金子的游戏」· C++ 代码 · 共 35 行

CPP
35
字号
#include "stdafx.h"
#include "filereport.h"
#include "stdio.h"


FILEREPORT::FILEREPORT()
{
	fp=fopen("trace.txt","w");

}

FILEREPORT::FILEREPORT(char *p)
{
	fp=fopen(p,"w");

}

FILEREPORT::~FILEREPORT()
{
	fclose(fp);
}

void FILEREPORT::put(char *p)
{
	fwrite(p,sizeof(char),strlen(p),fp);
	fwrite("\n",1,1,fp);
}

void FILEREPORT::put(char *p,int a,int b)
{
	char temp[50];
	sprintf(temp,"%s : %d , %d",p,a,b);
	fwrite(temp,sizeof(char),strlen(temp),fp);
	fwrite("\n",1,1,fp);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?