wrmj0830
wrmj0830
2015-10-21 09:48

c++报错'decltype' was not declared in this scope

  • c++

在codeblacks中运行这段程序
#include
#include
using namespace std;
int main()
{
string s("Hello World!!!");
decltype(s.size()) punct_cnt=0;
for(auto c:s)
if(ispunct(c))
punct_cnt+=1;
cout<<punct_cnt
<<" punctuation characters in"<<s<<endl;
return 0;
}
报错error: 'decltype' was not declared in this scope
不知道哪里错了 求大神指教

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答