-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson_maker.cpp
More file actions
39 lines (28 loc) · 765 Bytes
/
json_maker.cpp
File metadata and controls
39 lines (28 loc) · 765 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
37
38
using namespace std;
#define GET_VARIABLE_NAME(Variable) (#Variable)
#define cont 1
#define stop 0
void maker(char Main[],string,string,int flag=cont);
void maker(char Main[],string,double,int flag=cont);
void maker(char Main[],string varName,string strval,int flag)
{
strcat(Main,"\"");
strcat(Main,varName.c_str());
strcat(Main,"\"");
strcat(Main," : ");
strcat(Main,"\"");
strcat(Main,strval.c_str());
strcat(Main,"\"");
if(flag==1)
strcat(Main,", ");
}
void maker(char Main[],string varName,double strval,int flag)
{
strcat(Main,"\"");
strcat(Main,varName.c_str());
strcat(Main,"\"");
strcat(Main," : ");
strcat(Main,to_string(strval).c_str());
if(flag==1)
strcat(Main,", ");
}