g_s(mingw)說to_string不是std的成員我正在制作一個(gè)小詞匯記憶程序,其中的單詞將隨機(jī)閃現(xiàn)在我的意思中。我想使用標(biāo)準(zhǔn)的C ++庫,就像Bjarne Stroustroup告訴我們的那樣,但我遇到了一個(gè)看似奇怪的問題。我想將long整數(shù)更改std::string為能夠?qū)⑵浯鎯?chǔ)在文件中。我也受雇于to_string()此。問題是,當(dāng)我使用g ++(版本4.7.0,如其--version標(biāo)志中所述)編譯它時(shí),它說: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'我的程序給出了這個(gè)錯(cuò)誤:#include <string>int main(){
std::to_string(0);
return 0;}但是,我知道它不可能是因?yàn)閙sdn庫清楚地說它存在并且早先關(guān)于Stack Overflow的問題(對(duì)于g ++版本4.5)說它可以用-std=c++0x旗標(biāo)打開。我究竟做錯(cuò)了什么?
g_s(mingw)說to_string不是std的成員
慕尼黑5688855
2019-12-15 16:04:10