-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
55 lines (51 loc) · 1.27 KB
/
main.cpp
File metadata and controls
55 lines (51 loc) · 1.27 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
*autor : DragonQwl
*data : 2016/12/12
* : 2.0
* : include this feature : \xn
* */
#include <stdio.h>
#include "generalframework.h"
#include <windows.h>
int main()
{
char *dst_str = NULL;
int len_src = 0;
char arc_string(ONE_STRING_LENGHTH) = {0};
FILE * fp_in = fopen(SRC_ADD, "r");
if(NULL == fp_in)
{
puts("the src file cann't open !! \n");
getchar();
return NULL;
}
while(!feof(fp_in))
{
FILE * fp_out = fopen(GEN_RAN_STR,"a");
if(NULL == fp_out)
{
puts("the arc file cann't open! \n");
getchar();
return NULL;
}
fgets(src_string,ONE_STRING_LENGTH, fp_in);
dst_str = GeneralFramework_ver_1(src_string);
if(NULL == dst_str)
{
fclose(fp_out);
continue;
}
len_src = strlen(dst_str);
dst_str = (char *)realloc(dst_str,sizeof(char) * (len_src + 1));
MyStrnCat(dst_str, "\n",len_src, 1);
fwrite(dst_str,sizeof(char), len_src + 1, fp_out);
Sleep(1);
fclose(fp_out);
puts(dst_str);
}
free(dst_str);
dst_str = NULL;
fclose(fp_in);
getchar();
return 0;
}