我想在VC++(VStudio 2003)中使用stringstream對象,但當我使用超載的< <運算符來嘗試設置某些操縱器時,出現錯誤。stringstream操縱器&vstudio 2003
我嘗試以下操作:
int SomeInt = 1;
stringstream StrStream;
StrStream << std::setw(2) << SomeInt;
這不會編譯(錯誤C2593: '運營商< <' 不明確)。
VStudio 2003是否支持以這種方式使用操縱器?
我知道我可以直接在stringstream對象上設置寬度,例如StrStream.width(2);
我想知道爲什麼更常用的方法不起作用?
我失蹤頭。非常感謝! –
2008-09-16 06:23:07