【子项目:下令系统(Command System)】C++自制下令系统( 开辟ing | 踩坑 ...

鼠扑  金牌会员 | 2024-10-15 08:57:56 | 显示全部楼层 | 阅读模式
打印 上一主题 下一主题

主题 922|帖子 922|积分 2766

项目配景

在某一项目中,碰到了需要自制下令系统的需求,而这个模块的复用性很高,因此单独拉出来做一个子项目
更新日记

[2024.10.15 - 10:00] 增
项目进度

----[ 2024.10.15 10:00 ]----

  • 首先实现最基础的输入输出功能,用std::getline读入行再分割成字符串数组
- main.cpp
[code]#include #include #include #include #include     //for std::strtok#include "cmd_sys.h"//using namespace std;    //byte冲突,在后续项目中要用到//封装成模块时,应删掉全部下面的using,制止冲突using std::cin;using std::cout;using std::endl;using std::string;using std::vector;void mainloop(void) {    string full_cmd;    string cmd;    char* arg_;    //个人习惯使用"_"作为临时变量名    vector args;    while(1) {        cout
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

鼠扑

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表