服务器之家:专注于VPS、云服务器配置技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|Java教程|ASP教程|编程技术|正则表达式|C/C++|IOS|C#|Swift|Android|VB|R语言|JavaScript|易语言|vb.net|

服务器之家 - 编程语言 - C/C++ - C++类实现通讯录功能

C++类实现通讯录功能

2023-02-07 14:54LinAckerman C/C++

这篇文章主要为大家详细介绍了C++类实现通讯录功能,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

本文实例为大家分享了C++类实现通讯录功能的具体代码,供大家参考,具体内容如下

软件使用的是Microsoft Visual Studio

编写通讯录之前,先思考一下要实现什么功能,大概的结构,要创建几个类等等。

首先,是思考要实现什么功能。

一般的通讯录有添加,删除,修改,查找,显示等功能,一般联系人的信息包括:姓名,性别,年龄,电话号码,家庭地址。

我们首先新建一个类,用来初始化姓名,年龄,性别,电话号码,家庭地址,这几个变量

?
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
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
#include<iostream>
#include<string>
//#include "MailList.hpp"
using namespace std;
class MailList
{
public:
    void setName(string);//给变量赋值函数
    void setAge(string);
    void setSex(string);
    void setTel(string);
    void setAddress(string);
    string getName();//返回变量值函数
    string getAge();
    string getSex();
    string getTel();
    string getAddress();
 
private:
    string name;//私有函数成员,定义变量
    string age;
    string sex;
    string tel;
    string address;
};
 
 
void MailList::setName(string name)
{
    this->name=name;
}
void MailList::setAge(string age)
{
    this->age=age;
}
void MailList::setSex(string sex)
{
    this->sex=sex;
}
void MailList::setTel(string tel)
{
    this->tel=tel;
}
void MailList::setAddress(string address)
{
    this->address=address;
}
string MailList::getName()
{
    return this->name;
}
string MailList::getAge()
{
    return this->age;
}
string MailList::getSex()
{
    return this->sex;
}
string MailList::getTel()
{
    return this->tel;
}
string MailList::getAddress()
{
    return this->address;
}

这里也可以使用构造函数初始化函数成员,构造函数函数名与类名一样。

然后,创建一个通讯录管理类,先把总的结构搭建起来

?
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
56
57
58
59
60
61
62
63
64
65
66
class MailListManager//通讯录管理类
{
public:
    MailListManager();//构造函数
    void initList();//初始化通讯录功能,在通讯录里记录为空时使用
    void insertList();//添加联系人功能,在通讯录里有记录时使用
    void showList();//显示联系人功能,显示通讯录中所有联系人的记录
    void deleteList();//删除联系人功能
    void selectList();//查找联系人功能
    void updateList();//修改联系人功能
    void dropList();//清空通讯录功能
    void save();//保存到文件,文件的写入
    void loading();//加载,读出文件
    string pw();//密码加密(我没能实现)
    int exiet(string);//检查联系人是否存在
 
private:
 
    MailList mail[Max];//数组,MailList类型,这属于实例化对象
    int len;//计数器
 
};
MailListManager::MailListManager()//构造函数就是用来初始化函数成员的,未初始化的函数成员不可用。这里初始化一下计数器
{
    len = 0;
}
int MailListManager::exiet(string name)//定义检查函数,检查联系人是否存在,以姓名的匹配为条件
{
 
}
void MailListManager::loading()//定义加载函数
{
 
}
void MailListManager::save()//定义保存函数
{
 
}
void MailListManager::initList()//定义初始化函数
{
 
}
void MailListManager::insertList()//定义添加函数
{
 
}
void MailListManager::showList()//定义显示函数
{
 
}
void MailListManager::updateList()//定义修改函数
{
 
}
void MailListManager::deleteList()//定义删除函数
{
 
}
void MailListManager::selectList()//定义查找函数
{
 
}
void MailListManager::dropList()//定义清空函数
{
 
}

总结构搭建好后,再开始编写里面的定义内容。

?
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
//这里声明部分就不显示了,直接看定义
 
void MailListManager::loading()//加载函数的定义
{
    len = 0;//计数器len,每次调用加载函数的时候都要重新初始化为0,这样做是防止之后添加联系人时重复加载导致保存多次。
    string name, sex, age, tel, address;//局部变量,每次使用都要声明一下的
    ifstream in;//实例化文件类“fstream”对象
    in.open("maillist/mail.txt");//打开文件
    if (!in)//如果文件未打开
    {
 
        cout << "--文件打开失败--" << endl;
        system("pause");
    }
    else
    {
        while (!in.eof())//如果未达到文件末尾
        {
            in >> name >> age >> sex >> tel >> address;
            if (in.fail())break;//ifstream类的作用是从文件中读出数据到控制台上,但没有显示出来,这就相当于再次赋值给数组,就是给之前声明的MailList类的数组,所以这里使用数组mail[*].***保存数据,因为不知道到底有多少数据,所以用死循环来控制,跳出条件是达到文件末尾就跳出,这样就可以保证将文件中的内容全部存到数组里
            mail[len].setName(name);
            mail[len].setAge(age);
            mail[len].setSex(sex);
            mail[len].setTel(tel);
            mail[len].setAddress(address);
            len++;
        }
    }
    in.close();
}
int MailListManager::exiet(string name)//检验联系人是否存在
{
    for (int i = 0; i < len; i++)//每当调用检验联系人的函数之前,一定要加载一下,让数据全部保存到控制台的数组中,且要从控制台输入一个名字传给检验联系人函数,让传入的名字与数组中的数据逐一对比,从而检验联系人是否存在
    {
        if (mail[i].getName() == name)
        {
            return i;//如果存在,返回数组下标
        }
    }
    return -1;//不存在,返回-1
}
void MailListManager::save()//保存文件函数
{
    ofstream out;//ofstream类的作用是把控制台上的数据写入文件
    out.open("maillist/mail.txt");//打开文件
    if (!out)//如果文件未打开
    {
        cout << "--文件打开失败--" << endl;
    }
    else
    {
        for (int i = 0; i < len; i++)//这里的计数器len的值来自之后定义的函数中,len的值取决于谁调用的保存函数
        {
            out << mail[i].getName() << " " << mail[i].getAge() << " " << mail[i].getSex() << " " << mail[i].getTel() << " " << mail[i].getAddress() << endl;
        }
    }
 
 
    out.close();
}
 
 
void MailListManager::initList()//初始化联系人。之前我先写了添加,修改,删除,在解决一些问题的时候发现添加功能调用加载函数与删除修改功能调用加载函数有冲突,导致重复显示,所以在老师的帮助下加入了这个初始化联系人功能,当然有更好的方法,只是我暂时还不会用(TvT)
{
    string name, age, sex, tel, address;
    cout << "请输入联系人的信息(在姓名后输入stop停止输入):" << endl;
    while (true)
    {
        cout << "姓名:";
        cin >> name;
        if (name == "stop") break;
        else
        {
            mail[len].setName(name);//简单的调用函数,不想讲了
            cout << "年龄:";
            cin >> age;
            mail[len].setAge(age);
            cout << "性别:";
            cin >> sex;
            mail[len].setSex(sex);
            cout << "电话号码:";
            cin >> tel;
            mail[len].setTel(tel);
            cout << "家庭地址:";
            cin >> address;
            mail[len].setAddress(address);
            len++;//这个len最终的值会给到save.....emmm..说“给”好像不太准确,找不到合适的词了,反正代码顺着往下执,len加到最后不会再变了,save直接用它。
        }
    }
    save();
 
}
void MailListManager::insertList()//添加联系人函数
{
    this->loading();//加载一下初始化联系人的数据
    string name, age, sex, tel, address;//局部变量要重新声明
    cout << "请输入插入联系人的数量:" << endl;
    int count = 0;//再来个计数器,控制每次想要添加的联系人的数量
    cin >> count;//让用户来指定每次添加多少人
    for (int i = 0; i < count; i++)
    {
        cout << "姓名:";
        cin >> name;
        mail[i].setName(name);//函数调用过程,还是说一下吧。mail[]数组的类型是MailList,然后它是MailListManager这个类的函数成员,通过它作为桥梁来调用MailListManager类成员函数
        cout << "年龄:";
        cin >> age;
        mail[i].setAge(age);
        cout << "性别:";
        cin >> sex;
        mail[i].setSex(sex);
        cout << "电话号码:";
        cin >> tel;
        mail[i].setTel(tel);
        cout << "家庭地址:";
        cin >> address;
        mail[i].setAddress(address);
    }
    ofstream out;//添加有单独的保存文件定义,因为只有添加功能需要使用文件追加
    out.open("maillist/mail.txt", ios::app);
    if (!out)
    {
        cout << "--文件打开失败--" << endl;
    }
    else
    {
        for (int i = 0; i < count; i++)
        {
            out << mail[i].getName() << " " << mail[i].getAge() << " " << mail[i].getSex() << " " << mail[i].getTel() << " " << mail[i].getAddress() << endl;
        }
        out.close();
    }
}
void MailListManager::showList()//显示联系人
{
 
    loading();
    MailList temp;
    for (int j=0;j<len;j++)//这里是给联系人排序,通过名字排序
    {
        for (int i = j+1; i < len; i++)
        {
            if (mail[j].getName() > mail[i].getName())
            {
                temp = mail[i];
                mail[i] = mail[j];//交换
                mail[j] = temp;    
            }
        }
        
    }
    for (int i = 0; i < len; i++)//这里的len值来自loading()
    {
        cout << setw(10) << mail[i].getName() << "  " << setw(8) << mail[i].getAge() << "  " << setw(4) <<
            mail[i].getSex() << "  " << setw(15) << mail[i].getTel() << "  " << setw(20) << mail[i].getAddress();//setw()是格式控制函数
        cout << endl << endl;
    }
}
void MailListManager::updateList()//修改联系人,修改联系人之前要找到这个联系人,存在才能删除
{
    loading();//加载一下
    string name, age, sex, tel, address;
    cout << "请输入要修改的联系人姓名:";
    cin >> name;
    int ret = exiet(name);//检验一下是否存在,存在exiet()会返回该联系人所在的数组下标,在这个数组下标里重新输入一遍数据覆盖掉原有数据就是修改联系人了
    if (ret != -1)
    {
        cout << "请重新输入联系人信息:" << endl;
        cout << "姓名:";
        cin >> name;
        mail[ret].setName(name);
        cout << "年龄:";
        cin >> age;
        mail[ret].setAge(age);
        cout << "性别:";
        cin >> sex;
        mail[ret].setSex(sex);
        cout << "电话号码:";
        cin >> tel;
        mail[ret].setTel(tel);
        cout << "家庭地址:";
        cin >> address;
        mail[ret].setAddress(address);
    }
    else
        cout << "啊哦~联系人不存在喔(-o-)";
    save();//改完记得重新保存一下,不然是没有任何改动的哦
}
void MailListManager::deleteList()//删除联系人,理同修改一样,只不过是信息的覆盖变为了内容前移覆盖
{
    loading();
    string name;
    int o;
    cout << "请输入要删除的联系人的姓名:  ";
    cin >> name;
    int ret = exiet(name);
    if (ret == -1)
    {
        cout << "啊哦~联系人不存在喔(-o-)";
    }
    else
    {
        cout << "确定要删除吗?" << endl << "1.确定" << "    " << "2.我再想想" << endl << "请选择:";
        cin >> o;
        if (o == 2)
            cout << "好的~";
        else
        {
 
            for (int i = ret; i < len; i++)
            {
                mail[i] = mail[i + 1];
            }
 
 
            cout << "删除成功!";
        }
    }
    save();
 
}
void MailListManager::selectList()//查找联系人,查找联系人就更简单啦,调用一下检验存在的函数,然后根据下标直接输出此联系人信息就好
{
    loading();
    string name;
    cout << "请输入要查找的人的姓名:   ";
    cin >> name;
    int ret = exiet(name);
    if (ret != -1)
    {
        cout << "姓名:" << mail[ret].getName() << endl;
        cout << "年龄:" << mail[ret].getAge() << endl;
        cout << "性别:" << mail[ret].getSex() << endl;
        cout << "电话号码:" << mail[ret].getTel() << endl;
        cout << "家庭地址:" << mail[ret].getAddress() << endl;
    }
    else
        cout << "啊哦~联系人不存在喔(-o-)";
}
void MailListManager::dropList()//清空通讯录,重新写入文件,写入一个空字符覆盖之前的数据,就清空啦
{
    int n;
    cout << "确定清空吗?" << endl << "  " << "1.YES" << "   " << "2.NO" << "请选择:";
    cin >> n;
    if (n == 2)
    {
        cout << "好的~";
    }
    else
    {
        ofstream out;
        out.open("maillist/mail.txt");
        if (!out)
        {
            cout << "--文件打开失败--" << endl;
        }
        else
        {
            out << " ";
            cout << "清除成功" << endl;
        }
        out.close();
    }
}
string MailListManager::pw()//密码加密,未完成
{
    char psw[100] = { 0 }, c;
    int i = 0;
/*    cin >> c*/;
    while ((c = getch()) != '\r')
    {
        if (c != '\b')
        {
            cout << "*";
            psw[i++];
        }
        else
        {
            cout << "\b \b";
            i--;
        }
    }
    psw[i] = '\0';
    cout << psw;
    
}

然后再写个登陆类

?
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
class User
{
public:
    User();
    void loading();
    int check(string);
    int login(string, string);
    void sign(string,string);
private:
    string s[50];
    int len;
 
};
User::User()
{
    len = 0;
}
 
void User::loading()//加载函数
{
    string name, password;
    ifstream in;
    in.open("User/user.txt");
    if (!in)
    {
        cout << "错误!";
    }
    else
    {
        while (!in.eof())
        {
            in >> s[len];
            if (in.fail())break;
            len++;
        }
 
    }
    in.close();
}
int User::check(string name)//检验函数
{
    loading();
    for (int i = 0; i < len; i=i+2)
    {
        if (name == s[i])
        {
            return i;
        }
        else
        {
            return -1;
        }
    }
}
int User::login(string name, string password)//登陆函数
{
    if (check(name) == -1)
    {
        cout << "用户根本不存在喔!";
    }
    else
    {
        if (s[check(name) + 1] == password)
        {
            return 1;
        }
        else
        {
            cout << "密码输入错误!";
        }
    }
}
void User::sign(string name,string password)//注册函数
{
    loading();
    if (check(name) != -1)//已有用户名
    {
        cout << "用户名已存在!";
    }
    else
    {
        ofstream out;
        out.open("User/user.txt", ios::app);
        if (!out)
        {
            cout << "文件打开失败!";
        }
        else
        {
            out <<endl<< name<<" "<< password;
        }
        out.close();
        cout << "                                            注册成功!";
        system("pause");
    }
}

登陆类的加载函数,检验函数逻辑同之前管理类的一样,登陆函数与注册函数,实际上就是文件读出与写入。

最后,写主函数

?
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#include"MailListManager.hpp"
#include"userl.hpp"
void menu()
{
    cout << endl << endl << endl ;
    cout << "                                            -----------(^O^)---------" << endl;
    cout << "                                            -     1、初始化联系人   -" << endl;
    cout << "                                            -     2、显示联系人     -" << endl;
    cout << "                                            -     3、删除联系人     -" << endl;
    cout << "                                            -     4、查找联系人     -" << endl;
    cout << "                                            -     5、修改联系人     -" << endl;
    cout << "                                            -     6、清空联系人     -" << endl;
    cout << "                                            -     7、添加联系人     -" << endl;
    cout << "                                            -     0、退出通讯录     -" << endl;
    cout << "                                            ---------(·v·)---------" << endl;
}//手动格式控制O(∩_∩)O哈哈~
int main()
{
    User u;//实例化对象
    int e;
    cout << endl << endl << endl << endl << endl << endl;
    cout << "                            ******************欢迎使用通讯录管理系统~******************" << endl;
    cout << "                            *                                                         *" << endl;
    cout << "                            *                                                         *" << endl;
    cout << "                            *                                                         *" << endl;
    cout << "                            **********************              ***********************" << endl;
    cout << "                            **1.我已有账户,登录**" <<"              "<< "** 2.我没有账户,注册**" << endl;
    cout << "                            **********************              ***********************" << endl;//这是一个登陆界面,有账户才能管理通讯录哦
    cout << endl<<endl;
    cout<<"                                 请选择:";
    cin >> e;
    if (e == 1)
    {
        while (true)
        {
            MailListManager* m = new MailListManager;//来个指针指向堆区
            system("cls");
            string name, password;
            cout <<endl<<endl<< "                                            请输入:" << endl << "                                            用户名:";
            cin >> name;
            cout << endl << "                                            密码:";
            cin >> password;
            /*password = getch();*/  //这两段本来是用来密码加密的,但我没实现所以注释掉了
            /*m->pw();*/
            /*password = putch(getch());*/
            int i = u.login(name, password);//调用User里的登陆函数,并将返回值给i,i=1就证明用户名密码输入正确,反之就是输入错误
            if (i == 1)
            {
                int n;
                while (true)
                {
                    system("cls");
                    cout <<endl<<endl<< "                                            登录成功!欢迎" << name << endl;
                    cout << "                                            通讯录管理系统功能选项" << endl;
                    menu();
                    cout << "                                            请选择:";
                    cin >> n;
                    switch (n)
                    {
                    case 7:system("cls"); m->insertList(); system("pause"); break;
                    case 2:system("cls"); m->showList(); system("pause"); break;
                    case 3:system("cls"); m->deleteList();  system("pause"); break;
                    case 4:system("cls"); m->selectList(); system("pause"); break;
                    case 5:system("cls"); m->updateList(); system("pause"); break;
                    case 6:system("cls"); m->dropList(); system("pause"); break;
                    case 1:system("cls"); m->initList(); system("pause"); break;//调用各种函数
                    case 0:exit(0); break;
                    }
                }
                delete m;
                m = NULL;
            }
            else
            {
                cout<<endl<<endl << "                                            请重新输入" << endl;
                system("pause");
            }
        }
 
    }
    else
    {
        u.loading();//调用User类里的加载函数
        while (true)
        {
            system("cls");
            string name, password;
            cout <<endl<<endl<< "                                            请输入:" << endl << "                                            用户名:";
            cin >> name;
            if (u.check(name) !=-1)
            {
                cout << "                                            用户名已存在!请重新输入:"<<endl;
                system("pause");
            }
            else
            {
                MailListManager* m = new MailListManager;
                cout << endl << "                                            密码:";
                cin >> password;
                /*m->pw();*/
                u.sign(name, password);//调用User类的注册函数,保存注册用户信息
                int n;
                while (true)
                {
                    system("cls");
                    cout <<endl<<endl<< "                                            注册成功!欢迎" << name << endl;
                    cout << "                                            通讯录管理系统功能选项" << endl;
                    menu();
                    cout << "                                            请选择:";
                    cin >> n;
                    switch (n)
                    {
                    case 1:system("cls"); m->insertList(); system("pause"); break;
                    case 2:system("cls"); m->showList(); system("pause"); break;
                    case 3:system("cls"); m->deleteList();  system("pause"); break;
                    case 4:system("cls"); m->selectList(); system("pause"); break;
                    case 5:system("cls"); m->updateList(); system("pause"); break;
                    case 6:system("cls"); m->dropList(); system("pause"); break;
                    case 7:system("cls"); m->initList(); system("pause"); break;//调用各种函数
                    case 0: exit(0); break;
                    }
                }
            }
        }
    }
    return 0;
}

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。

原文链接:https://blog.csdn.net/m0_62149803/article/details/122287838

延伸 · 阅读

精彩推荐
  • C/C++C语言lseek()函数详解

    C语言lseek()函数详解

    这篇文章主要介绍了C语言lseek()函数详解,本篇文章通过简要的案例,讲解了该项技术的了解与使用,以下就是详细内容,需要的朋友可以参考下...

    FML71696802021-12-16
  • C/C++C++函数重载的深入解析

    C++函数重载的深入解析

    在C++中,我们也能够把具有相同功能的函数整合到一个函数上,而不必去写好多个函数名不同的函数,这叫做函数的重载。以下是对C++中的函数重载进行了...

    C++教程网3612020-12-20
  • C/C++浅析C语言中sscanf 的用法

    浅析C语言中sscanf 的用法

    以下是对C语言中sscanf函数的使用方法进行了详细的分析介绍,需要的朋友参考下...

    C语言教程网3432020-12-17
  • C/C++求32位机器上unsigned int的最大值及int的最大值的解决方法

    求32位机器上unsigned int的最大值及int的最大值的解决方法

    本篇文章是对求32位机器上unsigned int的最大值及int的最大值的解决方法进行了详细的分析介绍,需要的朋友参考下...

    C语言教程网2802020-12-15
  • C/C++C++如何获取系统信息 C++获取IP地址、硬件信息等

    C++如何获取系统信息 C++获取IP地址、硬件信息等

    这篇文章主要为大家详细介绍了C++如何获取系统信,C++获取IP地址、硬件信息等,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...

    lynch057112702021-07-28
  • C/C++Opencv实现联合双边滤波

    Opencv实现联合双边滤波

    这篇文章主要为大家详细介绍了Opencv实现联合双边滤波,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...

    时光碎了天12242022-01-20
  • C/C++C语言实现三子棋游戏详解

    C语言实现三子棋游戏详解

    这篇文章主要为大家详细介绍了C语言实现三子棋游戏详解,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...

    fchwpo?8002021-12-06
  • C/C++C++基于Boost库实现命令行解析

    C++基于Boost库实现命令行解析

    Boost库中默认自带了一个功能强大的命令行参数解析器,以往我都是自己实现参数解析的,今天偶尔发现这个好东西,就来总结一下参数解析的基本用法,...

    lyshark4772021-11-18