マルチマップを宣言する方法に問題があるようです:
std::multimap<int, std::string> table;
次のエラーメッセージが表示され続け、これを解決する方法に非常に行き詰まっています!
error: ISO C++ forbids declaration of ‘multimap’ with no type
error: invalid use of ‘::’
error: expected ‘;’ before ‘<’ token
C++ で multimap を試すのはこれが初めてです。これが些細な問題のように思われたら申し訳ありません。誰かが私を正しい方向に向けてもらえますか?
私のcentral.hには次のコードがあります
class Central{
private:
int address;
std::multimap<int, std::string> table;
public:
Central(int _address);
central.cpp:
#include <iostream>
#include <string>
#include <sstream>
#include <map>
using namespace std;
#include "central.h"
Central::Central(int _address)
{
address = _address;
}
お時間をいただきありがとうございます!:)