error: ‘to_string’ was not declared in this scope
错误:error: ‘to_string’ was not declared in this scope原因:to_string是C++11引入的新功能,旧版本编译器可能不支持它,所以要给编译器加上“C++11”编译支持解决方案:Linux下的GCC编译器:在 g++ 命令行加入编译选项-std=c++11,例如:g++ -o test test.cpp ...