本文介绍了C ++错误此声明没有存储类或类型说明符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include<map>
using namespace std;
typedef map<char,char> charMap;

//take a global variable for this map
charMap g_charMap;
int i; //it is working fine
g_charMap.insert(make_pair('{','}'));//Above mentioned Error is shown in this line

int main()
{
  //some stuff is there.
}





任何人都可以告诉我的理由和解决方案?



Can anyone please tell me reason and solution?

推荐答案

charMap g_charMap;
int main()
   {
   g_charMap.insert(make_pair('{','}'));
   //some stuff is there.
   }




这篇关于C ++错误此声明没有存储类或类型说明符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 20:01
查看更多