0
荫新VC++荫尝试使用地图::插入功能在下面的代码插入问题与阵列
int _tmain(int argc, _TCHAR* argv[]){
int arr[3] ={0,1,2};
map <int, int[3]> mymap;
std::map<int,int[3]>::iterator it = mymap.begin();
mymap.insert(it,std::make_pair(1,arr));
}
荫越来越 错误C2664写程序:“标准::对< _Ty1,_Ty2> STD :: _树< _Traits> ::插入(标准::对& &):标准::对< _Ty1,_Ty2>不能从转换参数2 '' 到 '的std ::对< _Ty1,_Ty2> & &'
请问你能给解答如何解决这个错误
感谢
错误C2039: '阵列':不是 'STD' \t 错误C2059的成员:语法错误: '{' 错误C2065:编曲':未声明的标识符\t 错误C2065:编曲' :未声明的标识符 错误C2065:'Arr':未声明的标识符 错误C2143:语法错误:缺少';'之前'{'\t 错误C2143:语法错误:缺少';'之前}} \t 错误C2143:语法错误:缺少';'之前'='\t 错误C2873:'Arr':符号不能在使用声明中使用 错误C2923:'std :: map':'Arr'不是参数'_Ty'的有效模板类型参数 – user3253682
两个事情,你需要用C++ 11进行编译支持。它看起来已经很好了,因为这个错误不会抱怨'using'语法。然后,像标准库中的其他所有内容一样,你需要包含正确的头文件#include' –
galop1n
#include iam面临相同的错误。请详细解释,因为iam新增了C++ .... –
user3253682