【发布时间】:2014-02-04 20:16:27
【问题描述】:
#include "Person.h"
#include <string>
using namespace std;
string Person::toSimpleString(){
return getFirstName() + " " + getLastName() + ", Age " + to_string(5);
}
我所有的字符串都工作正常,但我根本无法让 to_string 函数工作。 Eclipse 一直告诉我它超出了范围。什么
【问题讨论】:
-
Eclipse 是给你一个 codan 警告,还是你得到一个编译错误?
-
您需要使用 C++11 支持进行编译,才能使用 std::to_string
-
您的编译选项中是否启用了 C++11?
-
如何启用 c++11?
-
你用的是什么编译器?
标签: c++ scope eclipse-cdt