g_s(mingw)說to_string不是std的成員我正在制作一個小詞匯記憶程序,其中的單詞將隨機閃現在我的意思中。我想使用標準的C ++庫,就像Bjarne Stroustroup告訴我們的那樣,但我遇到了一個看似奇怪的問題。我想將long整數更改std::string為能夠將其存儲在文件中。我也受雇于to_string()此。問題是,當我使用g ++(版本4.7.0,如其--version標志中所述)編譯它時,它說:PS C:\Users\Anurag\SkyDrive\College\Programs> g++ -std=c++0x ttd.cpp
ttd.cpp: In function 'int main()':ttd.cpp:11:2: error: 'to_string' is not a member of 'std'我的程序給出了這個錯誤:#include <string>int main(){
std::to_string(0);
return 0;}但是,我知道它不可能是因為msdn庫清楚地說它存在并且早先關于Stack Overflow的問題(對于g ++版本4.5)說它可以用-std=c++0x旗標打開。我究竟做錯了什么?
g_s(mingw)說to_string不是std的成員
慕尼黑5688855
2019-12-15 16:04:10