- 博客(4)
- 收藏
- 关注
原创 STL容器利用merge合并自定义数据类型容器时报错:no matching member function for call to ‘construct‘
报错入下图所示:代码为:#include <iostream>#include <string>#include <algorithm>#include <vector>using namespace std;//merge 两个容器元素合并,并存储到另一个容器中/*函数原型:merge(iterator beg1, iterator end1, iterator beg2, iterator end2, iterator
2021-07-19 00:17:16
1318
6
原创 C++ map容器降序编译报错:error: no matching function for call to object of type ‘const MyCompare‘
今天在学习C++的map容器排序时,跟着老师的课程做map容器的降序排序时编译报错,报错提示:error: no matching function for call to object of type 'const MyCompare'对着老师的代码看了半天,确认一个字符都没有敲错。但是视频中老师的可以正常输出,我这一摸一样的代码确报错。搞的很是恼火。。。我的代码:#include <iostream>#include <string>#include &l
2021-07-12 01:37:21
1536
2
原创 C++警告 comparison between NULL and non-pointer (‘int‘ and NULL) [-Wnull-arithmetic] 解决方法
学习C++时,在判断int类型的m_EmpNum是否为空时,编译器报警:comparison between NULL and non-pointer ('int' and NULL) [-Wnull-arithmetic]
2021-06-20 21:33:50
3687
转载 C++ 一行代码判断是否回文字符串
#include <iostream>#include <string>using namespace std;bool test01(string str){ return equal(str.begin(), str.end(), str.rbegin());};int main(){ string str; cin >> str; bool ret = test01(str); if (ret) {.
2021-06-16 19:08:56
262
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人