-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintf.cpp
More file actions
36 lines (29 loc) · 728 Bytes
/
Printf.cpp
File metadata and controls
36 lines (29 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* \file Printf.cpp
* \brief
*/
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <assert.h>
//---------------------------------------------------------------------------
void
logAppend(const char *pcszFilePath, const char *pcszText)
{
assert(NULL != pcszFilePath);
assert(NULL != pcszText);
setlocale(LC_ALL, "");
FILE *pFile = fopen(pcszFilePath, "a");
assert(NULL != pFile);
fprintf(pFile, "%s", pcszText);
fclose(pFile);
pFile = NULL;
}
//---------------------------------------------------------------------------
int main(int, char **)
{
::logAppend("./Test.log", "msg\n");
return 0;
}
//---------------------------------------------------------------------------