FILE * fp;
char path[100];
char LogFile[100];
char tmpDate[30];
time_t now;
struct tm *p;
time(&now);
p = localtime(&now);
strftime(tmpDate, 29, "%Y%m%d", p);
path = "//A//B//C//";
sprintf (LogFile, "%sd.%s.log"
, path
, tmpDate);
if ((fp = fopen(LogFile, "a")) != NULL) {
//写入内容
fflush(fp);
fclose(fp);
}