Lines 1-4
Link Here
|
1 |
#include <fstream.h> |
1 |
#include <fstream> |
2 |
|
2 |
|
3 |
#ifdef __WIN32__ |
3 |
#ifdef __WIN32__ |
4 |
char file_path[50] = "C:\\Program Files\\Pengpong\\"; |
4 |
char file_path[50] = "C:\\Program Files\\Pengpong\\"; |
Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
void read_config_file() |
18 |
void read_config_file() |
19 |
{ |
19 |
{ |
20 |
ifstream a_file; |
20 |
std::ifstream a_file; |
21 |
char *temp_string1, *temp_string2; |
21 |
char *temp_string1, *temp_string2; |
22 |
char *temp_config_path; |
22 |
char *temp_config_path; |
23 |
temp_string1 = new char[50]; |
23 |
temp_string1 = new char[50]; |
Lines 75-81
Link Here
|
75 |
|
75 |
|
76 |
void write_config_file() |
76 |
void write_config_file() |
77 |
{ |
77 |
{ |
78 |
ofstream b_file; |
78 |
std::ofstream b_file; |
79 |
char *temp_config_path; |
79 |
char *temp_config_path; |
80 |
char *temp_config_data; |
80 |
char *temp_config_data; |
81 |
temp_config_data = new char[80]; |
81 |
temp_config_data = new char[80]; |
Lines 90-96
Link Here
|
90 |
strcpy(temp_config_path, config_file_path); |
90 |
strcpy(temp_config_path, config_file_path); |
91 |
#endif |
91 |
#endif |
92 |
|
92 |
|
93 |
b_file.open(temp_config_path, ios::trunc); |
93 |
b_file.open(temp_config_path, std::ios::trunc); |
|
|
94 |
|
94 |
|
95 |
|
95 |
sprintf(temp_config_data, "player1_name:%s\n", adam.name); |
96 |
sprintf(temp_config_data, "player1_name:%s\n", adam.name); |
96 |
b_file<<temp_config_data; |
97 |
b_file<<temp_config_data; |