c++ - 错误::unordered_map 在 int 之前未声明和预期的主表达式
问题描述
编译错误:: unordered_map 未在第 5 行声明
第 15 行中 int 之前的预期主表达式:: "unordered_map (int,int) hashmap;"
有时错误可以通过使用“使用命名空间标准”来解决,但在这里它仍然没有得到解决
#include <iostream>
#include <unordered_map>
using namespace std;
int help(int n, unordered_map <int,int> hashmap)
{
return 0;
}
int main()
{
int n;
cin>>n;
unordered_map <int,int> hashmap;
cout<<help(n,hashmap)<<endl;
}
解决方案
推荐阅读
- c++ - 为什么我的合并排序程序出现分段错误错误
- visual-studio-code - 通过 VSCode-Remote-SSH 终端访问时,远程机器不要求提供私人仓库的 git 用户/密码
- nativescript - NativeScript Angular .ics 文件导出
- java - Hibernate 查询不返回结果,但 CLI 上的相同查询返回 1 个结果
- python - 是否可以在 Python 中使用参数调用 getter 和 setter 属性?
- laravel - 存储外部访问/刷新令牌
- python - Pandas groupby 特定数据
- php - 将文件(来自 s3)附加到邮件
- r - 如何在 R 中的 plot() 上为最大值着色?
- java - 如何同时多次调用方法