摘要: 1、去除空格 string.erase(std::remove_if(string.begin(), string.end(), std::isspace), string.end()); 2、去除指定单词 std::string a = "class * A"; a = a.substr(a.fi 阅读全文
posted @ 2021-11-12 17:30 朱小勇 阅读(62) 评论(0) 推荐(0)
摘要: 1、功能 打印变量的类型 2、使用 ①、 int a; cout<<typeid(a).name();//int class A{ }; A a; cout<<typeid(a);//class A A* b = new A(); cout<<typeid(b);//class A * 3、获取继承 阅读全文
posted @ 2021-11-12 13:17 朱小勇 阅读(550) 评论(0) 推荐(0)
摘要: 模板类的声明和实现不能分开放,需要都放在头文件里 阅读全文
posted @ 2021-11-12 13:13 朱小勇 阅读(91) 评论(0) 推荐(0)