C++ ISO C&x2B+;禁止申报‘;多重映射&x2019;没有类型

C++ ISO C&x2B+;禁止申报‘;多重映射&x2019;没有类型,c++,multimap,C++,Multimap,我声明多重映射的方式似乎有问题: std::multimap<int, std::string> table; std::多映射表; 我一直收到下面的错误消息,我一直在思考如何解决这个问题 error: ISO C++ forbids declaration of ‘multimap’ with no type error: invalid use of ‘::’ error: expected ‘;’ before ‘<’ token 错误:ISO C++禁止声明“多点

我声明多重映射的方式似乎有问题:

std::multimap<int, std::string> table;
std::多映射表;
我一直收到下面的错误消息,我一直在思考如何解决这个问题

error: ISO C++ forbids declaration of ‘multimap’ with no type
error: invalid use of ‘::’
error: expected ‘;’ before ‘<’ token
<代码>错误:ISO C++禁止声明“多点”,没有类型 错误:对“:”的使用无效
错误:应为“;”在“之前,您没有
#包括
d
。这就是为什么编译器认为multimap是一个变量而不是一个类型。

您没有
#include
d
。这就是为什么编译器认为multimap是一个变量而不是一个类型。

您需要包含头。顺便说一句,漂亮的皮特汉克斯;I’谢谢你的帮助。我现在开始工作了。你需要包括标题。顺便说一句,漂亮的皮特汉克斯;I’谢谢你的帮助。我现在让它工作了。
class Central{
  private:
  int address;
  std::multimap<int, std::string> table;

public:
  Central(int _address);
#include <iostream>
#include <string>
#include <sstream>
#include <map>

using namespace std;

#include "central.h"

Central::Central(int _address)
{
    address = _address;         
}